From 855a86a8f6356b6b109e16ce44f93592daa824a3 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 8 Dec 2016 21:30:32 +0100 Subject: [PATCH] Switch these around to make the ESD automatically assign to things like chests again Closes #471 --- .../mod/tile/TileEntityInputter.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java index ad073858f..533276ebe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -145,17 +145,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt this.placeToPull = this.worldObj.getTileEntity(this.pos.offset(side)); if(this.slotToPullEnd <= 0 && this.placeToPull != null){ - if(this.placeToPull instanceof IInventory){ - this.slotToPullEnd = ((IInventory)this.placeToPull).getSizeInventory(); - } - else{ - if(this.placeToPull.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){ - IItemHandler cap = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); - if(cap != null){ - this.slotToPullEnd = cap.getSlots(); - } + if(this.placeToPull.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){ + IItemHandler cap = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + if(cap != null){ + this.slotToPullEnd = cap.getSlots(); } } + else if(this.placeToPull instanceof IInventory){ + this.slotToPullEnd = ((IInventory)this.placeToPull).getSizeInventory(); + } } } @@ -164,17 +162,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt this.placeToPut = this.worldObj.getTileEntity(this.pos.offset(side)); if(this.slotToPutEnd <= 0 && this.placeToPut != null){ - if(this.placeToPut instanceof IInventory){ - this.slotToPutEnd = ((IInventory)this.placeToPut).getSizeInventory(); - } - else{ - if(this.placeToPut.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){ - IItemHandler cap = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); - if(cap != null){ - this.slotToPutEnd = cap.getSlots(); - } + if(this.placeToPut.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)){ + IItemHandler cap = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + if(cap != null){ + this.slotToPutEnd = cap.getSlots(); } } + else if(this.placeToPut instanceof IInventory){ + this.slotToPutEnd = ((IInventory)this.placeToPut).getSizeInventory(); + } } } }