Posted June 9, 20169 yr 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
June 9, 20169 yr 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. http://p455w0rd.net/images/forumsignature.png[/img]
June 9, 20169 yr Author Thanks for your reply, I guess it's off to figure out packets and networking!
June 9, 20169 yr the best post for this can be found here: http://www.minecraftforge.net/forum/index.php?topic=20135.0 http://p455w0rd.net/images/forumsignature.png[/img]
June 9, 20169 yr Author 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.
June 9, 20169 yr 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.
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.