Made the Advanced ESD respect its whitelist again.

Yes, really.
This commit is contained in:
Ellpeck 2016-07-23 22:29:00 +02:00
parent 12d1fe26cc
commit 5bac637c35

View file

@ -30,8 +30,6 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
public static final int PUT_FILTER_START = 13; public static final int PUT_FILTER_START = 13;
public static final int PULL_FILTER_START = 1; public static final int PULL_FILTER_START = 1;
public static final int WHITELIST_PULL_BUTTON_ID = 87;
public static final int WHITELIST_PUT_BUTTON_ID = 88;
public static final int OKAY_BUTTON_ID = 133; public static final int OKAY_BUTTON_ID = 133;
public int sideToPut = -1; public int sideToPut = -1;
public int slotToPutStart; public int slotToPutStart;
@ -88,8 +86,10 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
IItemHandler cap = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side); IItemHandler cap = this.placeToPull.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side);
if(cap != null){ if(cap != null){
for(int i = Math.max(this.slotToPullStart, 0); i < Math.min(this.slotToPullEnd, cap.getSlots()); i++){ for(int i = Math.max(this.slotToPullStart, 0); i < Math.min(this.slotToPullEnd, cap.getSlots()); i++){
if(WorldUtil.doItemInteraction(i, 0, this.placeToPull, this, side, null)){ if(this.checkBothFilters(cap.getStackInSlot(i), false)){
return true; if(WorldUtil.doItemInteraction(i, 0, this.placeToPull, this, side, null)){
return true;
}
} }
} }
} }
@ -99,13 +99,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
} }
private boolean newPutting(){ private boolean newPutting(){
for(EnumFacing side : EnumFacing.values()){ if(this.checkBothFilters(this.slots[0], true)){
if(this.placeToPut.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side)){ for(EnumFacing side : EnumFacing.values()){
IItemHandler cap = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side); if(this.placeToPut.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side)){
if(cap != null){ IItemHandler cap = this.placeToPut.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side);
for(int i = Math.max(this.slotToPutStart, 0); i < Math.min(this.slotToPutEnd, cap.getSlots()); i++){ if(cap != null){
if(WorldUtil.doItemInteraction(0, i, this, this.placeToPut, null, side)){ for(int i = Math.max(this.slotToPutStart, 0); i < Math.min(this.slotToPutEnd, cap.getSlots()); i++){
return true; if(WorldUtil.doItemInteraction(0, i, this, this.placeToPut, null, side)){
return true;
}
} }
} }
} }
@ -309,12 +311,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
* @return If the Item is filtered correctly * @return If the Item is filtered correctly
*/ */
private boolean checkBothFilters(ItemStack stack, boolean output){ private boolean checkBothFilters(ItemStack stack, boolean output){
if(!this.isAdvanced){ return !this.isAdvanced || (output ? this.rightFilter : this.leftFilter).check(stack, this.slots);
return true;
}
else{
return (output ? this.rightFilter : this.leftFilter).check(stack, this.slots);
}
} }
/** /**