Optimise matter fab a bit

This commit is contained in:
modmuss50 2019-04-03 22:09:44 +01:00
parent 925a7b4c0a
commit afe6a179af

View file

@ -88,11 +88,12 @@ public class TileMatterFabricator extends TilePowerAcceptor
}
private void addOutputProducts(int slot) {
if (inventory.getStackInSlot(slot).isEmpty()) {
ItemStack stack = getStackInSlot(slot);
if (stack.isEmpty()) {
inventory.setInventorySlotContents(slot, new ItemStack(ModItems.UU_MATTER));
}
else if (ItemUtils.isItemEqual(this.inventory.getStackInSlot(slot), new ItemStack(ModItems.UU_MATTER), true, true)) {
inventory.getStackInSlot(slot).setCount((Math.min(64, 1 + inventory.getStackInSlot(slot).getCount())));
else if (ItemUtils.isItemEqual(stack, new ItemStack(ModItems.UU_MATTER), true, true) && stack.getCount() < stack.getMaxStackSize()) {
inventory.getStackInSlot(slot).grow(1);
}
}