本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
示例4: onDataPacket
import net.minecraft.network.play.server.SPacketUpdateTileEntity; //导入依赖的package包/类
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
onChunkUnload();
readFromNBT(pkt.getNbtCompound());
onLoad();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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"));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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();
}
}
}