Jump to content

[1.7] Send inventory updates


mrkirby153

Recommended Posts

The furnace already sends an integer to the GUI, so al you would need to do is change where it gets the cook progress scaled and renders that as an image to just draw the burn time, cook time, or whatever you're looking for. Only the GUI should need to be changed as the container and the tile entity already take care of everything for you.

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

Link to comment
Share on other sites

Look at the vanilla furnace. To send the integer to the GUI, the container uses three methods. I think they're detectAndSendChanges, addCraftingToCrafters, and updateProgessBar. To have the time update, look at how the TileEntityFurnace class manages burnTime in updateEntity(). (Geez, I really need to do something different if I can remember all of that...)

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

Link to comment
Share on other sites

Umm... I thought it was pretty self explanatory... the three methods take a variable from the tile entity and send it to the gui. Since the gui can't read the tile entity since it's on the client and the tile is on the server, the container has to manage their variables to make sure they are the same. That's why you see these methods check if, for example, the last burn time of the gui is the same as the tile entity. If you want to use them, just sub in your variables that you'll be using. If you only want to do exactly what you said in the first post, then just edit the gui. The container should do everything you'd like, but if not, just sub in your variables for the already-existing ones.

If you really want help, give that modder a thank you.

 

Modders LOVE thank yous.

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.