From d84a1b7ba2df074986643c48012ba5f41a1487b5 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 28 May 2017 01:26:08 +0200 Subject: [PATCH] fix ESD not working with the lower bound being something else than 0 Closes #786 --- .../actuallyadditions/mod/tile/TileEntityInputter.java | 4 ++-- .../ellpeck/actuallyadditions/mod/util/WorldUtil.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 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 9f3739665..04f26cc55 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInputter.java @@ -85,7 +85,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt private boolean newPulling(){ for(EnumFacing side : this.placeToPull.keySet()){ - WorldUtil.doItemInteraction(this.placeToPull.get(side), this.wrapper, Integer.MAX_VALUE, this.slotToPullStart, this.slotToPullEnd, !this.isAdvanced ? null : this.leftFilter); + WorldUtil.doItemInteraction(this.placeToPull.get(side), this.wrapper, Integer.MAX_VALUE, this.slotToPullStart, this.slotToPullEnd, 0, 1, !this.isAdvanced ? null : this.leftFilter); if(this.placeToPull instanceof TileEntityItemViewer){ break; @@ -97,7 +97,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt private boolean newPutting(){ if(!this.isAdvanced || this.rightFilter.check(this.slots.getStackInSlot(0))){ for(EnumFacing side : this.placeToPut.keySet()){ - WorldUtil.doItemInteraction(this.wrapper, this.placeToPut.get(side), Integer.MAX_VALUE, this.slotToPutStart, this.slotToPutEnd, null); + WorldUtil.doItemInteraction(this.wrapper, this.placeToPut.get(side), Integer.MAX_VALUE, 0, 1, this.slotToPutStart, this.slotToPutEnd, null); if(this.placeToPut instanceof TileEntityItemViewer){ break; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index 806ff4653..c44002fd5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -63,16 +63,16 @@ public final class WorldUtil{ } public static boolean doItemInteraction(SlotlessableItemHandlerWrapper extractWrapper, SlotlessableItemHandlerWrapper insertWrapper, int maxExtract, FilterSettings filter){ - return doItemInteraction(extractWrapper, insertWrapper, maxExtract, 0, Integer.MAX_VALUE, filter); + return doItemInteraction(extractWrapper, insertWrapper, maxExtract, 0, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, filter); } - public static boolean doItemInteraction(SlotlessableItemHandlerWrapper extractWrapper, SlotlessableItemHandlerWrapper insertWrapper, int maxExtract, int slotStart, int slotEnd, FilterSettings filter){ - ItemStack theoreticalExtract = extractItem(extractWrapper, maxExtract, true, slotStart, slotEnd, filter); + public static boolean doItemInteraction(SlotlessableItemHandlerWrapper extractWrapper, SlotlessableItemHandlerWrapper insertWrapper, int maxExtract, int extractSlotStart, int extractSlotEnd, int insertSlotStart, int insertSlotEnd, FilterSettings filter){ + ItemStack theoreticalExtract = extractItem(extractWrapper, maxExtract, true, extractSlotStart, extractSlotEnd, filter); if(StackUtil.isValid(theoreticalExtract)){ - ItemStack remaining = insertItem(insertWrapper, theoreticalExtract, false, slotStart, slotEnd); + ItemStack remaining = insertItem(insertWrapper, theoreticalExtract, false, insertSlotStart, insertSlotEnd); if(!ItemStack.areItemStacksEqual(remaining, theoreticalExtract)){ int toExtract = !StackUtil.isValid(remaining) ? StackUtil.getStackSize(theoreticalExtract) : StackUtil.getStackSize(theoreticalExtract)-StackUtil.getStackSize(remaining); - extractItem(extractWrapper, toExtract, false, slotStart, slotEnd, filter); + extractItem(extractWrapper, toExtract, false, extractSlotStart, extractSlotEnd, filter); return true; } }