Advanced item handing, adding inventory-searching to basic item ejection- no longer will items get jammed

Also, fixed transmitter tooltips
This commit is contained in:
aidancbrady committed 2017-04-28 14:54:26 -04:00
1 parent 8a65923dc6
commit 21c49c1643
17 files changed
+632 -440

No files matched your search

@@ -62,24 +62,7 @@ public final class InvStack
public void use(int amount)
{
if(InventoryUtils.isItemHandler(tileEntity, side))
{
IItemHandler handler = InventoryUtils.getItemHandler(tileEntity, side);
for(int i = 0; i < slotIDs.size(); i++)
{
ItemStack stack = itemStacks.get(i);
int toUse = Math.min(amount, stack.getCount());
handler.extractItem(slotIDs.get(i), toUse, false);
amount -= toUse;
if(amount == 0)
{
return;
}
}
}
else if(tileEntity instanceof IInventory)
if(tileEntity instanceof IInventory)
{
IInventory inventory = InventoryUtils.checkChestInv((IInventory)tileEntity);
@@ -99,6 +82,23 @@ public final class InvStack
amount -= stack.getCount();
}
if(amount == 0)
{
return;
}
}
}
else if(InventoryUtils.isItemHandler(tileEntity, side))
{
IItemHandler handler = InventoryUtils.getItemHandler(tileEntity, side);
for(int i = 0; i < slotIDs.size(); i++)
{
ItemStack stack = itemStacks.get(i);
int toUse = Math.min(amount, stack.getCount());
handler.extractItem(slotIDs.get(i), toUse, false);
amount -= toUse;
if(amount == 0)
{
return;