Jump to content

1.11 inventory capabilities working with crafting matrix?


Viesis

Recommended Posts

So I switched over to the capabilities system (totally awesome), and want to know if there is something special I had to do to use the IInventory interfaces with the IItemHandler?  I saw for the Container Slot(), Forge has the SlotItemHandler() to work with the capabilities.  I want to create a crafting table that stores the items put into it in the ItemStackHandler. Any starting points I should look at? Any suggestion would be greatly appreciated.

Link to comment
Share on other sites

If you want to save the items in your crafting matrix, you'd have to store them in a

TileEntity

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I do have a tile entity made and working that can store items with the capabilities system. I just am not sure how to make my 3x3 slots that use the IItemHandler to the crafting result that seems to use IInventory (using the vanilla crafting table as my example).

Link to comment
Share on other sites

You'd have to copy the logic from SlotCrafting over to a custom class extending

SlotItemHandler

, and adapt it to the

IItemHandler

code.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I figured out my issue and am posting what I did to potentially help others.  You were right with the SlotItemHandler, but I used a different approach. Since my issue was with saving it to the capabilities storage, I decided to try and make it simple.  I was able to use the crafting matrix and the IInventory crafting result (used with the vanilla workbench), and created a extra load/save method.  When you click on my workbench now, it loads the items from the TileEntity inventory into the matrix, and when you close, it saves the item slots from the matrix back into the TileEntity inventory.  Nice and easy. I do appreciate the help.

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.