Posted November 27, 201311 yr What way is correct to do the subject manipulation ? Just usual interaction like tile.doSuff() or via packets ? My case is tile's rendering class that implements TileEntitySpecialRenderer. It has my TileEntity class on input (renderAModelAt) . I need to do it so i can change my tile's rendering system, checking tile's nbt. But it always works incorrectly.
November 27, 201311 yr NBT data is not synced between the client and server. So if you change anything on the server you will need to send a packet to inform the client that it's changed. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
November 28, 201311 yr Author And how do I use these tile's methods to notify client about nbt changes ?
November 28, 201311 yr @Override public Packet getDescriptionPacket(){ NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tag); } @Override public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt){ readFromNBT(pkt.data); } public void sendDescriptionPacket(){ PacketDispatcher.sendPacketToAllAround(xCoord, yCoord, zCoord, 64D, worldObj.provider.dimensionId, getDescriptionPacket()); } sendDescriptionPacket() is a 'homemade' method with which you can send the nbt packet to the client whenever you want. The fewer packets you send the better though. So the best that you can do is simulating the same behaviour on the client and on the server and only send a packet when you know the client will be desynched. Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.
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.