当前位置: 首页>>代码示例>>Java>>正文


Java SPacketUpdateTileEntity类代码示例

本文整理汇总了Java中net.minecraft.network.play.server.SPacketUpdateTileEntity的典型用法代码示例。如果您正苦于以下问题:Java SPacketUpdateTileEntity类的具体用法?Java SPacketUpdateTileEntity怎么用?Java SPacketUpdateTileEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SPacketUpdateTileEntity类属于net.minecraft.network.play.server包,在下文中一共展示了SPacketUpdateTileEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
	NBTTagCompound nbt = new NBTTagCompound();
	this.writeToNBT(nbt);

	return new SPacketUpdateTileEntity(getPos(), 0, nbt);
}
 
开发者ID:ArtixAllMighty,项目名称:ExSartagine,代码行数:8,代码来源:TileEntityCooker.java

示例2: sendTileEntityUpdate

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
private void sendTileEntityUpdate(TileEntity p_147097_1_)
{
    if (p_147097_1_ != null)
    {
        SPacketUpdateTileEntity spacketupdatetileentity = p_147097_1_.getUpdatePacket();

        if (spacketupdatetileentity != null)
        {
            this.connection.sendPacket(spacketupdatetileentity);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:EntityPlayerMP.java

示例3: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tagCom = new NBTTagCompound();
    this.writeUpdateTag(tagCom);
    return new SPacketUpdateTileEntity(pos, getBlockMetadata(),tagCom);
}
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:8,代码来源:TileEntityChalkBase.java

示例4: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    onChunkUnload();
    readFromNBT(pkt.getNbtCompound());
    onLoad();
}
 
开发者ID:iChun,项目名称:GeneralLaymansAestheticSpyingScreen,代码行数:8,代码来源:TileEntityGlassBase.java

示例5: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
	
	if (packet != null && packet.getNbtCompound() != null)
		readCustomNBT(packet.getNbtCompound());
	
	markBlockForRenderUpdate();
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:9,代码来源:TileArtisia.java

示例6: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbtTag = new NBTTagCompound();
    nbtTag.setInteger("timeout", timeout);
    nbtTag.setInteger("start", Config.portalTimeout - timeout);
    nbtTag.setByte("portalSide", (byte) portalSide.ordinal());
    return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:10,代码来源:PortalTileEntity.java

示例7: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
public SPacketUpdateTileEntity getUpdatePacket()
{
	NBTTagCompound nbtTag = new NBTTagCompound();
	this.writeToNBT(nbtTag);
	return new SPacketUpdateTileEntity(pos, 1, nbtTag);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:8,代码来源:TileEntityAnimaConjurer.java

示例8: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound nbtTagCompound = new NBTTagCompound();
    this.writeToNBT(nbtTagCompound);
    return new SPacketUpdateTileEntity(getPos(), 1, nbtTagCompound);
}
 
开发者ID:CreeperShift,项目名称:WirelessCharger,代码行数:8,代码来源:TilePersonalCharger.java

示例9: onDataPacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    super.onDataPacket(net, pkt);
    setOpened(pkt.getNbtCompound().getBoolean("opened"));
}
 
开发者ID:PearXTeam,项目名称:PurificatiMagicae,代码行数:8,代码来源:TileCodeStorage.java

示例10: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound network = getNetworkNBT(true);
    if(network == null) return null;

    return new SPacketUpdateTileEntity(pos, 0, network);
}
 
开发者ID:Guichaguri,项目名称:ProjectEon,代码行数:9,代码来源:TileEntityBase.java

示例11: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
    NBTTagCompound tag = new NBTTagCompound();
    writeToNBT(tag);
    return new SPacketUpdateTileEntity(getPos(), 0, tag);
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:8,代码来源:GeneratorBase.java

示例12: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
	
	NBTTagCompound nbtTag = new NBTTagCompound();
	this.writeCustomNBT(nbtTag);
	
	return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:10,代码来源:TileArtisia.java

示例13: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
   public SPacketUpdateTileEntity getUpdatePacket()
   {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return new SPacketUpdateTileEntity(pos, 1, tag);
   }
 
开发者ID:einsteinsci,项目名称:BetterBeginningsReborn,代码行数:8,代码来源:TileEntityBB.java

示例14: getUpdatePacket

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Nullable
public SPacketUpdateTileEntity getUpdatePacket()
{
    if (this.isSendToClient())
    {
        this.setSendToClient(false);
        NBTTagCompound nbttagcompound = this.writeToNBT(new NBTTagCompound());
        return new SPacketUpdateTileEntity(this.pos, 2, nbttagcompound);
    }
    else
    {
        return null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:TileEntityCommandBlock.java

示例15: handleUpdateTileEntity

import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
/**
 * Updates the NBTTagCompound metadata of instances of the following entitytypes: Mob spawners, command blocks,
 * beacons, skulls, flowerpot
 */
public void handleUpdateTileEntity(SPacketUpdateTileEntity packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);

    if (this.gameController.theWorld.isBlockLoaded(packetIn.getPos()))
    {
        TileEntity tileentity = this.gameController.theWorld.getTileEntity(packetIn.getPos());
        int i = packetIn.getTileEntityType();
        boolean flag = i == 2 && tileentity instanceof TileEntityCommandBlock;

        if (i == 1 && tileentity instanceof TileEntityMobSpawner || flag || i == 3 && tileentity instanceof TileEntityBeacon || i == 4 && tileentity instanceof TileEntitySkull || i == 5 && tileentity instanceof TileEntityFlowerPot || i == 6 && tileentity instanceof TileEntityBanner || i == 7 && tileentity instanceof TileEntityStructure || i == 8 && tileentity instanceof TileEntityEndGateway || i == 9 && tileentity instanceof TileEntitySign)
        {
            tileentity.readFromNBT(packetIn.getNbtCompound());
        }
        else
        {
            if(tileentity == null)
            {
                LOGGER.error("Received invalid update packet for null tile entity at {} with data: {}", packetIn.getPos(), packetIn.getNbtCompound());
                return;
            }
            tileentity.onDataPacket(netManager, packetIn);
        }

        if (flag && this.gameController.currentScreen instanceof GuiCommandBlock)
        {
            ((GuiCommandBlock)this.gameController.currentScreen).updateGui();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:NetHandlerPlayClient.java


注:本文中的net.minecraft.network.play.server.SPacketUpdateTileEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。