Jump to content

[SOLVED] [1.9.4] Items reset in GUI after clicking button


Ugdhar

Recommended Posts

Hi, I'm tinkering around with modding, and I've run into an issue that I can't figure out, despite quite a lot of searching.

 

I have a block (gem grinder), that has a tile entity, and a container and gui, and this all seems to work fine. I added a button, and can read when it's clicked. The problem is, I want it to remove a diamond from the top slot (0), and then put a new item (diamond dust) into the bottom slot. This *looks* like it works, but as soon as i touch any of the items, it all reverts back to the original configuration. I'm sure this is some sort of client/server sync issue, but I thought because I had a container, I didn't have to worry so much about that. Any pointers in the right direction would help. Also, first post, so I apologize if I am missing any important information, or breaching any etiquette. Thank you for your time!

 

Gem Grinder Block: https://github.com/Ugdhar/funextras/blob/master/src/java/ugdhar/funextras/blocks/BlockGemGrinder.java

Tile Entity: https://github.com/Ugdhar/funextras/blob/master/src/java/ugdhar/funextras/tileentity/TileEntityGemGrinder.java

Container: https://github.com/Ugdhar/funextras/blob/master/src/java/ugdhar/funextras/inventory/ContainerGemGrinder.java

Gui: https://github.com/Ugdhar/funextras/blob/master/src/java/ugdhar/funextras/client/gui/GuiGemGrinder.java

GuiHandler: https://github.com/Ugdhar/funextras/blob/master/src/java/ugdhar/funextras/client/gui/ModGuiHandler.java

Link to comment
Share on other sites

That's the one I'm looking at now, thanks!

 

I'm sure once I break it down I'll figure it out, I had a time with the whole tileentity/container/gui thing until I made myself a little flowchart of how everything related to each other, then it worked fine, until I got to this point lol.

Link to comment
Share on other sites

That's the one I'm looking at now, thanks!

 

I'm sure once I break it down I'll figure it out, I had a time with the whole tileentity/container/gui thing until I made myself a little flowchart of how everything related to each other, then it worked fine, until I got to this point lol.

 

Now photocopy that sheet and label one side "client" and the other side "server." ;)

(Oh, and scribble out the GuiContainer on the server side and the Container on the client side).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

×
×
  • Create New...

Important Information

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