mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-25 16:38:33 +01:00
fix ESD not working with the lower bound being something else than 0
Closes #786
This commit is contained in:
parent
ffef81fdaa
commit
d84a1b7ba2
2 changed files with 7 additions and 7 deletions
|
@ -85,7 +85,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
|
|
||||||
private boolean newPulling(){
|
private boolean newPulling(){
|
||||||
for(EnumFacing side : this.placeToPull.keySet()){
|
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){
|
if(this.placeToPull instanceof TileEntityItemViewer){
|
||||||
break;
|
break;
|
||||||
|
@ -97,7 +97,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt
|
||||||
private boolean newPutting(){
|
private boolean newPutting(){
|
||||||
if(!this.isAdvanced || this.rightFilter.check(this.slots.getStackInSlot(0))){
|
if(!this.isAdvanced || this.rightFilter.check(this.slots.getStackInSlot(0))){
|
||||||
for(EnumFacing side : this.placeToPut.keySet()){
|
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){
|
if(this.placeToPut instanceof TileEntityItemViewer){
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -63,16 +63,16 @@ public final class WorldUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean doItemInteraction(SlotlessableItemHandlerWrapper extractWrapper, SlotlessableItemHandlerWrapper insertWrapper, int maxExtract, FilterSettings filter){
|
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){
|
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, slotStart, slotEnd, filter);
|
ItemStack theoreticalExtract = extractItem(extractWrapper, maxExtract, true, extractSlotStart, extractSlotEnd, filter);
|
||||||
if(StackUtil.isValid(theoreticalExtract)){
|
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)){
|
if(!ItemStack.areItemStacksEqual(remaining, theoreticalExtract)){
|
||||||
int toExtract = !StackUtil.isValid(remaining) ? StackUtil.getStackSize(theoreticalExtract) : StackUtil.getStackSize(theoreticalExtract)-StackUtil.getStackSize(remaining);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue