@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbt = new NBTTagCompound(); this.writeToNBT(nbt); return new SPacketUpdateTileEntity(getPos(), 0, nbt); }
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); } } }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound tagCom = new NBTTagCompound(); this.writeUpdateTag(tagCom); return new SPacketUpdateTileEntity(pos, getBlockMetadata(),tagCom); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { onChunkUnload(); readFromNBT(pkt.getNbtCompound()); onLoad(); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { if (packet != null && packet.getNbtCompound() != null) readCustomNBT(packet.getNbtCompound()); markBlockForRenderUpdate(); }
@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); }
@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new SPacketUpdateTileEntity(pos, 1, nbtTag); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbtTagCompound = new NBTTagCompound(); this.writeToNBT(nbtTagCompound); return new SPacketUpdateTileEntity(getPos(), 1, nbtTagCompound); }
@Override @SideOnly(Side.CLIENT) public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { super.onDataPacket(net, pkt); setOpened(pkt.getNbtCompound().getBoolean("opened")); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound network = getNetworkNBT(true); if(network == null) return null; return new SPacketUpdateTileEntity(pos, 0, network); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new SPacketUpdateTileEntity(getPos(), 0, tag); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeCustomNBT(nbtTag); return new SPacketUpdateTileEntity(getPos(), 1, nbtTag); }
@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new SPacketUpdateTileEntity(pos, 1, tag); }
@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; } }
/** * 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(); } } }
private void sendBlockEntity(@Nullable TileEntity be) { if (be != null) { SPacketUpdateTileEntity spacketupdatetileentity = be.getUpdatePacket(); if (spacketupdatetileentity != null) { this.sendPacket(spacketupdatetileentity); } } }
@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound tagCompound = new NBTTagCompound(); this.writeToNBT(tagCompound); return new SPacketUpdateTileEntity(pos, 1, tagCompound); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { this.readFromNBT(pkt.getNbtCompound()); }
@Override @Nullable public SPacketUpdateTileEntity getUpdatePacket() { //System.out.println("update"); return new SPacketUpdateTileEntity(this.pos, 1, this.getUpdateTag()); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { this.deserializeNBT(pkt.getNbtCompound()); }
@Override public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(pos, 0, getUpdateTag()); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, getBlockMetadata(), getUpdateTag()); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { super.onDataPacket(net, pkt); PacketDescription packet = new PacketDescription(pkt.getNbtCompound()); packet.handleClientSide(packet, PneumaticCraftRepressurized.proxy.getPlayer()); }
@Override @Nullable public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, 0, this.getUpdateTag()); }
@Nullable public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, 6, this.getUpdateTag()); }
@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound nbttagcompound = getUpdateTag(); return new SPacketUpdateTileEntity(this.getPos(), -999, nbttagcompound); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { NBTTagCompound tagCom = pkt.getNbtCompound(); readUpdateTag(tagCom); }
@Nullable @Override public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(getPos(), 0, getUpdateTag()); }
@Nullable public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, 10, this.getUpdateTag()); }
@Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) { readFromNBT(pkt.getNbtCompound()); }
@SideOnly(Side.CLIENT) @Override public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { this.readFromNBT(packet.getNbtCompound()); }
@Nullable public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, 3, this.getUpdateTag()); }
@Nullable public SPacketUpdateTileEntity getUpdatePacket() { return new SPacketUpdateTileEntity(this.pos, 8, this.getUpdateTag()); }