Jump to content

[Solved] TileEntity Inventory Can't add or remove items


Recommended Posts

Posted

I have made a custom TileEntity that has a single slot inventory. However, when I try to click an item in the created inventory, it just drops the item. It seems like a client/server desync, but I'm not sure. Also, when i shift click i get this error spammed to my console:

 

2013-11-21 20:30:25 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.retrySlotClick(Container.java:520)

2013-11-21 20:30:25 [iNFO] [sTDOUT] at net.minecraft.inventory.Container.slotClick(Container.java:291)

 

It repeats so much that i cannot view the actual error, which is very useful...

 

My code can be found here: https://github.com/lexwebb/opticraft

 

TileEntity: https://github.com/lexwebb/opticraft/blob/master/entitys/TileEntityItemLaser.java

Block: https://github.com/lexwebb/opticraft/blob/master/blocks/ItemLaserBlock.java

Container: https://github.com/lexwebb/opticraft/blob/master/blocks/containers/ItemLaserContainer.java

GuiHandler: https://github.com/lexwebb/opticraft/blob/master/client/gui/GuiHandler.java

 

If there's anything I missed please let me know!

 

Thanks in advance!

 

Posted

Thanks! I have fixed the not being able to click items by adding missing code to getServerGuiElement to return my Container (Updated on GitHub). However, now when I try and access the inventory the windows instantly closes. Any ideas?

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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.