Posted February 15, 201411 yr Not sure if the title is the correct name for my problem. I want to recreate something similar to the furnace but instead of having progress bars showing the time left, I want to have numbers. The thing is how would I send the updates to the player and stuff like that. http://i.imgur.com/gWwyMMO.jpg[/img]
February 15, 201411 yr 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.
February 15, 201411 yr Author 1) How would I send the integer to the GUI and 2) How do I have the time update? http://i.imgur.com/gWwyMMO.jpg[/img]
February 15, 201411 yr 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.
February 15, 201411 yr Author I looked at them, copied them into my class but yet I have no idea on what they do or how to use them. Can you explain them please? http://i.imgur.com/gWwyMMO.jpg[/img]
February 15, 201411 yr 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.
February 16, 201411 yr Author Ok, so I made some implementations to my code just to test and the value stays mostly at 20000 and occasionally flickers to 19999. Gui Class updateEntity() method http://i.imgur.com/gWwyMMO.jpg[/img]
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.