Jump to content

[1.10.2] Capability system and slots shared between facings


Naheulf

Recommended Posts

Hello,

With new capability system, how to detect if  a slot is accessible through multiple sides ?

For example :

If a foo TileEntity has 3 slots. Slot "0" is accessible from top facing. Slot "1" is accessible only from all sides. Slot "2" is accessible from bottom side.

IItemHandler topHandler      = foo.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,  EnumFacing.UP);   //Slots "0" and "1"
IItemHandler bottomHandler   = foo.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,  EnumFacing.DOWN); //Slots "1" and "2"
IItemHandler internalHandler = foo.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);             //Slots "0", "1" and "2"

How to detect that slot slot "1"  is included in topHandler and bottomHandler ?

topHandler.getStackInSlot(1) == bottomHandler.getStackInSlot(0) // Not work if slot is empty or if getStackInSlot return an ItemStack.copy()

 

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.

Announcements



×
×
  • Create New...

Important Information

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