Jump to content

[Solved] GuiContainer won't let me pick up items.


PCChazter

Recommended Posts

I'm not too sure if this is a bug, or just a mis-use of a GuiContainer. I am trying to make a gui open on an item's right click, with a couple extra custom slots. I got the player's inventory put into it, and decided to try it out, to make sure it was working so far, because I have not made a gui in the past. Everything seemed to be working, but when I try to click an Item, it doesn't let me pick it up, it just picks it up for a second, then puts it back. If I click an item that has another item in the slot above it, it will pick up the item from the slot above it, and empty both slots.

 

Thinking that maybe my code is conflicting with the gui somehow, I made a test mod with a gui, same thing.

I then decided to experiment a bit, so I added a few more slots (9 regular slots), and I was able to pick up items from my inventory, but not some of the 9 slots.

 

Thinking that maybe it has something to do with trying to use an item to call the gui, I made a block that would open the gui, and the exact same thing happened.

 

Can anyone please tell me if something is wrong with my code, or if this is just a bug? I have attached the source code for my test mod, with the 2 items, and 2 blocks

Link to comment
Share on other sites

So...I was scouring the internet (literally, looking at everything, trying to figure out why this is happening), and everyone else's code, tutorials, and examples all looked to be the same (minus mod-specific details). The only difference I could find (after scratching my head and searching for hours) is that the examples all are @NetworkMod. Sure enough, reverted all my code back to what is in the file I posted on the OP (literally copied and pasted), and made it a NetworkMod.....and it works! Seriously? Why does it even let you make a GuiContainer if it won't work?

 

Any thoughts Forge programmers?

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.