@Override public IMessage onMessage(PacketProgress message, MessageContext ctx) { TileEntity tile = message.getTileEntity(EnderCore.proxy.getClientWorld()); if (tile instanceof IProgressTile) { ((IProgressTile) tile).setProgress(message.progress); } return null; } }
/** * CLIENT: Called when chunk data is received (client receiving chunks from server). */ @Override public final void handleUpdateTag(@Nonnull NBTTagCompound tag) { super.handleUpdateTag(tag); readCustomNBT(NBTAction.CLIENT, tag); if (isProgressTile) { // TODO: nicer way to do this? This is needed so players who enter a chunk get a correct progress. ((IProgressTile) this).setProgress(tag.getFloat("tileprogress")); } }
/** * CLIENT: Called when block data is received (client receiving blocks from server, via notifyBlockUpdate). */ @Override public final void onDataPacket(@Nonnull NetworkManager net, @Nonnull SPacketUpdateTileEntity pkt) { readCustomNBT(NBTAction.CLIENT, pkt.getNbtCompound()); if (isProgressTile) { // TODO: nicer way to do this? This is needed so players who enter a chunk get a correct progress. ((IProgressTile) this).setProgress(pkt.getNbtCompound().getFloat("tileprogress")); } }