Check if cap exists first

This commit is contained in:
Raoul Van den Berge
2016-08-12 02:26:40 +02:00
parent 2ff2623b75
commit c968eedff1

View File

@@ -205,7 +205,7 @@ public abstract class TileBase extends TileEntity implements ITickable {
return null; return null;
} }
IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side); IItemHandler handler = tile.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) ? tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side) : null;
if (handler == null) { if (handler == null) {
if (side != null && tile instanceof ISidedInventory) { if (side != null && tile instanceof ISidedInventory) {