Jump to content

Help with syncing client and server [unsolved]


Recommended Posts

I am trying to make a tile entity that works like a gear shaft. The shaft is meant to connect to other shafts when I place them next to each other. I've set up the onNeighborBlockChange function to make adjacent shafts connect when you place one, but for some reason only the one I placed updates. A bit of debugging has told me that the shafts are updating correctly on the server side, but not on the client side. I have packet handling set up in the tile entity, and it's being updated correctly in the onDataPacket function, so I don't know why it's not updated correctly when rendering. Here is my code (I've only included the parts I think are important):


TileEntityShaft: http://pastebin.com/0tB535Sc

BlockShaft: http://pastebin.com/4Anj8dGb


If anyone wants the full code, it's at https://github.com/LogiCo-Modding/Geartech

Link to comment
Share on other sites

  • 2 weeks later...

After changing the tile entity's state, you need to call the block's markBlockForUpdate method -- this ensures that the state is sent to the client and the block is re-rendered. You should also call the tile entity's OnInventoryChanged method, otherwise the state might not get saved to disk.

Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.