Posted December 26, 20159 yr So, I am creating a custom inventory and such for my mod. Now, I finished the KeyHandler, Container, Gui, IInventory, and GuiHandler classes. But, the GuiHandler methods seem to not be firing off as they are suppose to. I thought I screwed up my instance, but I see nothing wrong. Here are the classes that may be affecting it: ModMain: http://pastebin.com/MHLQVs1N KeyHandler: http://pastebin.com/WEZC7Hm2 GuiHandler: http://pastebin.com/mWd5jT6u Inventory Class: http://pastebin.com/L2cQ85BC Gui: http://pastebin.com/LQLj5852 Container: http://pastebin.com/1yu6XxDv ModReference: http://pastebin.com/p4sw2B9b If you need anything else, just ask! Any help will be greatly appreciated. I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 27, 20159 yr The PacketPipeline has long been deprecated in favor of SimpleNetworkWrapper and IMessage - you should really switch. Also, you don't need to instantiate your mod instance, i.e. '= new ModMain()', as that is done automatically when your mod is loaded. Everything else looks good, though, from what I can tell, except you didn't show your packet class which presumably is what actually makes the call to open the GUI. Are you sure your packet is working properly? You need to show us that code. EDIT: Ninja'd by diesieben again... http://i.imgur.com/NdrFdld.png[/img]
December 27, 20159 yr Author I was actually following your tutorial for Packets Alias. Currently, I would like to make it work first then change my PacketHandling methods. Here is the Network code, the Packet is sent to the server (used print outs in keyhandler). PacketPipeline: http://pastebin.com/UseR7Nan OpenGuiPacket: http://pastebin.com/qKiJUNmC I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 27, 20159 yr Author Hm, I'll get to remaking my network. I feel it would be smart to update the Forge wiki networking tutorial with this. A lot of newcomers would be appreciative of this! I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 27, 20159 yr Yeah, that's not my packet tutorial, mate. You may have seen some code like that in my old 1.7.2 tutorials, but all the notes on updating and more recent tutorials use the SimpleNetworkWrapper. EDIT: Unless you are referring to the IEEP tutorial on Minecraft Forums - since their forum editor sucks so bad, I haven't bothered updating it since 1.7.2... but I do have an updated network tutorial which I mention in the custom inventory tutorials. http://i.imgur.com/NdrFdld.png[/img]
December 27, 20159 yr Author I was using the one for IEEP. I changed it to this simpler way, but am getting a "NoSuchMethodFound" error when attempting to send it to the server. I'm sure I'll figure it out, but if this is common, any solution? I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 27, 20159 yr Author Ah! Simply forgot to add a base constructor for the packet. Now, I need to open the gui in the packet. But, I completely forgot how I would be able to grab the playerEntity to do that. Any suggestions? I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 27, 20159 yr Ah! Simply forgot to add a base constructor for the packet. Now, I need to open the gui in the packet. But, I completely forgot how I would be able to grab the playerEntity to do that. Any suggestions? On the client side, Minecraft#thePlayer contains the client player. On the server side, MessageContext#getServerHandler returns the sending player's NetHandlerPlayServer and NetHandlerPlayServer#playerEntity contains the player. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
December 27, 20159 yr Author Thank you very much for that Choon! Seems to be working flawlessly after changing my network to the correct format. Thanks for the help everyone! I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
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.