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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

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