Implemented Priority System for the item routing system. Lower numbers are looked at first.

This commit is contained in:
WayofTime 2016-02-22 21:19:22 -05:00
parent 2c49c49441
commit 7104138e2b
10 changed files with 97 additions and 10 deletions

View file

@ -88,7 +88,7 @@ public class DefaultItemFilter implements IItemFilter
* the input inventory to the output inventory.
*/
@Override
public void transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer)
public int transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer)
{
boolean[] canAccessSlot = new boolean[accessedInventory.getSizeInventory()];
if (accessedInventory instanceof ISidedInventory)
@ -141,7 +141,11 @@ public class DefaultItemFilter implements IItemFilter
maxTransfer -= changeAmount;
accessedInventory.setInventorySlotContents(slot, inputStack.stackSize <= 0 ? null : inputStack); //Sets the slot in the inventory
return changeAmount;
}
return 0;
}
@Override

View file

@ -26,7 +26,7 @@ public interface IItemFilter
* This method is only called on an input filter to transfer ItemStacks from
* the input inventory to the output inventory.
*/
public void transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer);
public int transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer);
public boolean doesStackMatchFilter(ItemStack testStack);

View file

@ -215,7 +215,7 @@ public class TestItemFilter implements IItemFilter
* the input inventory to the output inventory.
*/
@Override
public void transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer)
public int transferThroughInputFilter(IItemFilter outputFilter, int maxTransfer)
{
boolean[] canAccessSlot = new boolean[accessedInventory.getSizeInventory()];
if (accessedInventory instanceof ISidedInventory)
@ -290,7 +290,11 @@ public class TestItemFilter implements IItemFilter
}
}
}
return changeAmount;
}
return 0;
}
@Override