cleaned up format and var names as requested by @CovertJaguar at #872
This commit is contained in:
parent
bece4fb77f
commit
a237829c3a
1 changed files with 20 additions and 22 deletions
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
package buildcraft.core.triggers;
|
package buildcraft.core.triggers;
|
||||||
|
|
||||||
import net.minecraft.inventory.*;
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
@ -61,26 +62,23 @@ public class TriggerInventory extends BCTrigger {
|
||||||
searchedStack = parameter.getItem();
|
searchedStack = parameter.getItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tile instanceof ISpecialInventory)
|
if (tile instanceof ISpecialInventory) {
|
||||||
{
|
ISpecialInventory specialInventory = (ISpecialInventory) tile;
|
||||||
ISpecialInventory special = (ISpecialInventory) tile;
|
ItemStack[] itemStacks;
|
||||||
ItemStack[] arr;
|
switch (state) {
|
||||||
int n;
|
|
||||||
switch (state)
|
|
||||||
{
|
|
||||||
case Contains:
|
case Contains:
|
||||||
arr = special.extractItem(false, side, 1);
|
itemStacks = specialInventory.extractItem(false, side, 1);
|
||||||
return arr != null && arr.length > 0 && arr[0] != null && arr[0].stackSize > 0
|
return itemStacks != null && itemStacks.length > 0 && itemStacks[0] != null && itemStacks[0].stackSize > 0 && (searchedStack == null || itemStacks[0].isItemEqual(searchedStack));
|
||||||
&& (searchedStack == null || arr[0].isItemEqual(searchedStack));
|
|
||||||
case Empty:
|
case Empty:
|
||||||
arr = special.extractItem(false, side, 1);
|
itemStacks = specialInventory.extractItem(false, side, 1);
|
||||||
return arr == null || arr.length == 0 || arr[0] == null || arr[0].stackSize == 0;
|
return itemStacks == null || itemStacks.length == 0 || itemStacks[0] == null || itemStacks[0].stackSize == 0;
|
||||||
case Full:
|
case Full:
|
||||||
break;
|
break;
|
||||||
case Space:
|
case Space:
|
||||||
if (searchedStack == null) break;
|
if (searchedStack == null)
|
||||||
n = special.addItem(searchedStack, false, side);
|
break;
|
||||||
return n > 0;
|
int added = specialInventory.addItem(searchedStack, false, side);
|
||||||
|
return added > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue