Posted September 30, 201213 yr Hi, I have a TileEntity, but when it's created, it only loads from NBT on the server side (in singleplayer, but on the 1.3 integrated server). How can I sync it between server and client? TileEntity: https://github.com/JackBeePee/ShadowCraft/blob/master/TEShadowCatcher.java (I want to sync the integer 'shadows')
September 30, 201213 yr Add these methods to your tile entity class. public Packet getAuxillaryInfoPacket() { NBTTagCompound tag = new NBTTagCompound(); this.writeToNBT(tag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, tag); } public void onDataPacket(NetworkManager net, Packet132TileEntityData packet) { NBTTagCompound tag = packet.customParam1; shadows = tag.getInteger("shadows"); }
October 1, 201213 yr getAuxillaryInfoPacket is the old name for note, if you are updated it is something like getDescriptionPacket or so. MCP changed it.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.