Ugdhar Posted June 9, 2016 Share Posted June 9, 2016 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 Quote Link to comment Share on other sites More sharing options...
p455w0rd Posted June 9, 2016 Share Posted June 9, 2016 You need to set up packet handling. The container doesn't handle packet handling automatically. So imo, you should send a packet to the client in an overridden Container#detectAndSendChanges method within your container. Quote http://p455w0rd.net/images/forumsignature.png[/img] Link to comment Share on other sites More sharing options...
Ugdhar Posted June 9, 2016 Author Share Posted June 9, 2016 Thanks for your reply, I guess it's off to figure out packets and networking! Quote Link to comment Share on other sites More sharing options...
p455w0rd Posted June 9, 2016 Share Posted June 9, 2016 the best post for this can be found here: http://www.minecraftforge.net/forum/index.php?topic=20135.0 Quote http://p455w0rd.net/images/forumsignature.png[/img] Link to comment Share on other sites More sharing options...
Ugdhar Posted June 9, 2016 Author Share Posted June 9, 2016 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. Quote Link to comment Share on other sites More sharing options...
Draco18s Posted June 9, 2016 Share Posted June 9, 2016 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). Quote 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 More sharing options...
Recommended Posts
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.