diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index 1f2c8190d..884deb7c9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -223,13 +223,13 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public boolean hasCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing){ - return this.getCapability(capability, facing) != null; + return this.canHandleCapability(capability) || super.hasCapability(capability, facing); } @Nonnull @Override public T getCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing){ - if(this.hasInvWrapperCapabilities() && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){ + if(this.canHandleCapability(capability)){ return (T)this.invWrappers[facing.ordinal()]; } else{ @@ -237,6 +237,10 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } } + private boolean canHandleCapability(Capability capability){ + return this.hasInvWrapperCapabilities() && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY; + } + public boolean hasInvWrapperCapabilities(){ return true; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 39b1e38b4..640885e50 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -122,6 +122,11 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return this.isBoundThingInRange() && (this.getSided() == null || this.getSided().canExtractItem(slot, stack, side)); } + @Override + public boolean hasCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing){ + return this.isBoundThingInRange() ? this.worldObj.getTileEntity(this.boundPosition).hasCapability(capability, facing) : super.hasCapability(capability, facing); + } + @Nonnull @Override public T getCapability(@Nonnull Capability capability, @Nonnull EnumFacing facing){