Jump to content

TileEntity not loading how it should


Abascus

Recommended Posts

My ItemStack[] in my TileEntity = null after entering the world, only if I open my Container the ItemStack[] gets filled with data, but i want it to be loaded on world startup, cause the rendering of the block is diffrent when there are diffrent Items inside it

 

Thanks

Link to comment
Share on other sites

You have to synchronize TileEntity on both sides: server -> client. It's done by implementing getDescriptionPacket and onDataPacket (when you want to force a server to send update you'd use worldObj.markBlockForUpdate).

 

Example: https://github.com/mnn/jaffas/blob/98acc4d9607d6493b82b277b3bfea3b7dacffc69/src/minecraft/monnef/jaffas/food/block/TileEntityPie.java

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

You have to synchronize TileEntity on both sides: server -> client. It's done by implementing getDescriptionPacket and onDataPacket (when you want to force a server to send update you'd use worldObj.markBlockForUpdate).

 

Example: https://github.com/mnn/jaffas/blob/98acc4d9607d6493b82b277b3bfea3b7dacffc69/src/minecraft/monnef/jaffas/food/block/TileEntityPie.java

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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