Fix inventory size calculating being 1 too low
This commit is contained in:
parent
6e76d4bec5
commit
cdc86c0591
1 changed files with 8 additions and 8 deletions
|
@ -36,7 +36,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
||||
|
||||
private IPowerProvider powerProvider;
|
||||
|
||||
|
||||
protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard;
|
||||
protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
powerProvider.configure(50, 1, 64, 1, 64);
|
||||
powerProvider.configurePowerPerdition(64, 1);
|
||||
}
|
||||
|
||||
|
||||
protected PipeItemsWood(int itemID, PipeTransportItems transport) {
|
||||
this(transport, new PipeLogicWood(), itemID);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
}
|
||||
return stacks;
|
||||
} else {
|
||||
|
||||
|
||||
IInventory inv = Utils.getInventory(inventory);
|
||||
ItemStack result = checkExtractGeneric(inv, doRemove, from, 0, inv.getSizeInventory() - 1);
|
||||
|
||||
|
@ -167,7 +167,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
|
||||
if (result != null)
|
||||
return new ItemStack[] { result };
|
||||
|
||||
|
||||
} else if (inventory instanceof net.minecraftforge.common.ISidedInventory) {
|
||||
net.minecraftforge.common.ISidedInventory sidedInv = (net.minecraftforge.common.ISidedInventory) inventory;
|
||||
|
||||
|
@ -180,7 +180,7 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
|
||||
if (result != null)
|
||||
return new ItemStack[] { result };
|
||||
|
||||
|
||||
} else if (inventory.getSizeInventory() == 2) {
|
||||
// This is an input-output inventory
|
||||
|
||||
|
@ -232,11 +232,11 @@ public class PipeItemsWood extends Pipe implements IPowerReceptor {
|
|||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
public ItemStack checkExtractGeneric(IInventory inventory, boolean doRemove, ForgeDirection from, int start, int stop) {
|
||||
return checkExtractGeneric(InventoryWrapper.getWrappedInventory(inventory), doRemove, from, Utils.createSlotArray(start, stop - start));
|
||||
return checkExtractGeneric(InventoryWrapper.getWrappedInventory(inventory), doRemove, from, Utils.createSlotArray(start, stop - start + 1));
|
||||
}
|
||||
|
||||
|
||||
public ItemStack checkExtractGeneric(ISidedInventory inventory, boolean doRemove, ForgeDirection from, int[] slots) {
|
||||
for(int k : slots) {
|
||||
ItemStack slot = inventory.getStackInSlot(k);
|
||||
|
|
Loading…
Reference in a new issue