本文整理匯總了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();
}
}
}