Posted July 13, 201411 yr Hello. I've created a custom rendered gate that open and closes with a gui button but it seems to open and close other gates in your view. I have looked at my code and cant see where im going wrong. I have all my code available on github https://github.com/paranormalryno/Test-Mod Thanks.
July 13, 201411 yr Hello. I've created a custom rendered gate that open and closes with a gui button but it seems to open and close other gates in your view. I have looked at my code and cant see where im going wrong. I have all my code available on github https://github.com/paranormalryno/Test-Mod Thanks. i think that you will need packets to sync your client(gui) with server.... Here could be your advertisement!
July 13, 201411 yr Author Thanks I will try and work out how to create packets over the next few days.
July 30, 201411 yr Author I have looked into packets and got the basics up but im stuck with how to sync the button press with the server. I have updated the github with the Packet Handler and Message class.
July 31, 201411 yr Author If you have a Container (which you do) you don't need custom packets. Just call Minecraft#playerController.sendEnchantPacket(windowID, buttonID) when the button is pressed. That will trigger a call to the enchantItem method on your Container on the server, with the same ID. I've added a enchantItem method in my container which now sends the command to open or close the gate and added the sendEnchantPacket under the actionPreformed sending the windowID and buttonID but im getting a NullPointerException. I not sure if I'm doing it correct but after looking at the enchantment GUI and Container class that's what I came up with.
August 11, 201411 yr Author Thanks. I can now click the button but now I'm back to square 1 where the gui opens a different gate. Github has been updated.
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.