Jump to content

Recommended Posts

Posted

I was able to add to my block ISidedInventory to allow it to hold and insert/extract items however when i try to remove the item from the book it duplicates. So a quick overview of my block; if the player is holding a book well he clicks my block it will remove the book and insert the book into the block. When the block is clicked again well the inventory is full it will remove the item and  spawn an entityItem which is the book into the world. The problem when removing the book by clicking it will duplicate the book if the player has more then 1 of the books in his hand. So for example you have 3 books in your hand and you click on the block(which is empty at this point) this removes a book from your hand and places it in the block so then when you click the block again to retrieve your book it spawns 2 books because that was how many i had after i placed the book. However even though this number is how many you have in your hand after adding the book it is not dependent on how many you have when removing the book so if i had 3 then placed 1 and then threw my 2nd one on the ground then clicked it would still spawn 2.

 

Block Code:

 

  Reveal hidden contents

 

 

Tile Entity Code:

 

  Reveal hidden contents

 

 

edit: added check to see if item in slot was greater then inventory stack limit then set it to stack limit if it was.

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.