diff --git a/src/main/java/techreborn/client/ClientEventHandler.java b/src/main/java/techreborn/client/ClientEventHandler.java index f3e41786f..063489d04 100644 --- a/src/main/java/techreborn/client/ClientEventHandler.java +++ b/src/main/java/techreborn/client/ClientEventHandler.java @@ -37,7 +37,7 @@ public class ClientEventHandler { @SubscribeEvent public static void renderPlayer(RenderPlayerEvent.Pre event) { EntityPlayer player = event.getEntityPlayer(); - Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != ItemStack.EMPTY + Item chestslot = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty() ? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null; if (chestslot != null && chestslot == ModItems.CLOAKING_DEVICE) { event.setCanceled(true); diff --git a/src/main/java/techreborn/command/TechRebornDevCommand.java b/src/main/java/techreborn/command/TechRebornDevCommand.java index 40c86951f..93c498e93 100644 --- a/src/main/java/techreborn/command/TechRebornDevCommand.java +++ b/src/main/java/techreborn/command/TechRebornDevCommand.java @@ -87,7 +87,7 @@ public class TechRebornDevCommand extends CommandBase { } } else if ("getname".equals(args[0])) { EntityPlayer player = (EntityPlayer) sender; - if (player.getHeldItem(EnumHand.MAIN_HAND) != ItemStack.EMPTY) { + if (!player.getHeldItem(EnumHand.MAIN_HAND).isEmpty()) { sender.sendMessage(new TextComponentString(player.getHeldItem(EnumHand.MAIN_HAND).getItem().getRegistryName() + ":" + player.getHeldItem(EnumHand.MAIN_HAND).getItemDamage())); } else { sender.sendMessage(new TextComponentString("hold an item!")); diff --git a/src/main/java/techreborn/events/TRTickHandler.java b/src/main/java/techreborn/events/TRTickHandler.java index 0775e006c..165536977 100644 --- a/src/main/java/techreborn/events/TRTickHandler.java +++ b/src/main/java/techreborn/events/TRTickHandler.java @@ -41,7 +41,7 @@ public class TRTickHandler { @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onPlayerTick(TickEvent.PlayerTickEvent e) { EntityPlayer player = e.player; - Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != ItemStack.EMPTY + Item chestslot = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty() ? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null; if (previouslyWearing != chestslot && previouslyWearing == ModItems.CLOAKING_DEVICE && player.isInvisible() diff --git a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java index f9a57cc6f..075c37fb7 100644 --- a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java +++ b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java @@ -71,7 +71,7 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo { IEnergyStorage capEnergy = itemStack.getCapability(CapabilityEnergy.ENERGY, null); for (int i = 0; i < player.inventory.getSizeInventory(); i++) { - if (player.inventory.getStackInSlot(i) != ItemStack.EMPTY) { + if (!player.inventory.getStackInSlot(i).isEmpty()) { ItemStack item = player.inventory.getStackInSlot(i); if (!item.hasCapability(CapabilityEnergy.ENERGY, null)) { continue; diff --git a/src/main/java/techreborn/tiles/TileTechStorageBase.java b/src/main/java/techreborn/tiles/TileTechStorageBase.java index f0fca398f..6f9d45028 100644 --- a/src/main/java/techreborn/tiles/TileTechStorageBase.java +++ b/src/main/java/techreborn/tiles/TileTechStorageBase.java @@ -144,7 +144,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase if (!getStackInSlot(1).isEmpty()) { outputStack = getStackInSlot(1); } - if (getStackInSlot(0) != ItemStack.EMPTY + if (!getStackInSlot(0).isEmpty() && (storedItem.getCount() + outputStack.getCount()) < maxCapacity) { ItemStack inputStack = getStackInSlot(0); if (getStoredItemType().isEmpty() @@ -167,7 +167,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase } if (!storedItem.isEmpty()) { - if (outputStack == ItemStack.EMPTY) { + if (outputStack.isEmpty()) { ItemStack delivered = storedItem.copy(); delivered.setCount(Math.min(storedItem.getCount(), delivered.getMaxStackSize())); @@ -257,7 +257,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase name = storedItem.getDisplayName(); size += storedItem.getCount(); } - if (getStackInSlot(1) != ItemStack.EMPTY) { + if (!getStackInSlot(1).isEmpty()) { name = getStackInSlot(1).getDisplayName(); size += getStackInSlot(1).getCount(); } diff --git a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java index 15bac969a..29f1bdbfe 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronAlloyFurnace.java @@ -136,12 +136,12 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase --this.burnTime; } if (!this.world.isRemote) { - if (this.burnTime != 0 || this.getStackInSlot(this.input1) != ItemStack.EMPTY && this.getStackInSlot(this.fuel) != ItemStack.EMPTY) { + if (this.burnTime != 0 || !this.getStackInSlot(this.input1).isEmpty()&& !this.getStackInSlot(this.fuel).isEmpty()) { if (this.burnTime == 0 && this.canSmelt()) { this.currentItemBurnTime = this.burnTime = TileIronAlloyFurnace.getItemBurnTime(this.getStackInSlot(this.fuel)); if (this.burnTime > 0) { flag1 = true; - if (this.getStackInSlot(this.fuel) != ItemStack.EMPTY) { + if (!this.getStackInSlot(this.fuel).isEmpty()) { this.decrStackSize(this.fuel, 1); } } @@ -191,7 +191,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase } private boolean canSmelt() { - if (this.getStackInSlot(this.input1) == ItemStack.EMPTY || this.getStackInSlot(this.input2) == ItemStack.EMPTY) { + if (this.getStackInSlot(this.input1).isEmpty() || this.getStackInSlot(this.input2).isEmpty()) { return false; } else { ItemStack itemstack = null; @@ -204,7 +204,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase if (itemstack == null) return false; - if (this.getStackInSlot(this.output) == ItemStack.EMPTY) + if (this.getStackInSlot(this.output).isEmpty()) return true; if (!this.getStackInSlot(this.output).isItemEqual(itemstack)) return false; @@ -237,7 +237,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase } } - if (this.getStackInSlot(this.output) == ItemStack.EMPTY) { + if (this.getStackInSlot(this.output).isEmpty()) { this.setInventorySlotContents(this.output, itemstack.copy()); } else if (this.getStackInSlot(this.output).getItem() == itemstack.getItem()) { this.decrStackSize(this.output, -itemstack.getCount()); diff --git a/src/main/java/techreborn/tiles/tier0/TileIronFurnace.java b/src/main/java/techreborn/tiles/tier0/TileIronFurnace.java index a6bb1971d..8bdba0f36 100644 --- a/src/main/java/techreborn/tiles/tier0/TileIronFurnace.java +++ b/src/main/java/techreborn/tiles/tier0/TileIronFurnace.java @@ -115,7 +115,7 @@ public class TileIronFurnace extends TileLegacyMachineBase if (this.canSmelt()) { final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.getStackInSlot(this.input1)); - if (this.getStackInSlot(this.output) == ItemStack.EMPTY) { + if (this.getStackInSlot(this.output).isEmpty()) { this.setInventorySlotContents(this.output, itemstack.copy()); } else if (this.getStackInSlot(this.output).isItemEqual(itemstack)) { this.getStackInSlot(this.output).grow(itemstack.getCount()); @@ -129,12 +129,12 @@ public class TileIronFurnace extends TileLegacyMachineBase } public boolean canSmelt() { - if (this.getStackInSlot(this.input1) == ItemStack.EMPTY) + if (this.getStackInSlot(this.input1).isEmpty()) return false; final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.getStackInSlot(this.input1)); if (itemstack.isEmpty()) return false; - if (this.getStackInSlot(this.output) == ItemStack.EMPTY) + if (this.getStackInSlot(this.output).isEmpty()) return true; if (!this.getStackInSlot(this.output).isItemEqual(itemstack)) return false; diff --git a/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java b/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java index fc855337b..ea76f3d33 100644 --- a/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java +++ b/src/main/java/techreborn/tiles/tier1/TileElectricFurnace.java @@ -71,7 +71,7 @@ public class TileElectricFurnace extends TilePowerAcceptor if (canSmelt()) { final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); - if (getStackInSlot(output) == ItemStack.EMPTY) { + if (getStackInSlot(output).isEmpty()) { setInventorySlotContents(output, itemstack.copy()); } else if (getStackInSlot(output).isItemEqual(itemstack)) { getStackInSlot(output).grow(itemstack.getCount()); @@ -85,14 +85,14 @@ public class TileElectricFurnace extends TilePowerAcceptor } public boolean canSmelt() { - if (getStackInSlot(input1) == ItemStack.EMPTY) { + if (getStackInSlot(input1).isEmpty()) { return false; } final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); if (itemstack.isEmpty()) { return false; } - if (getStackInSlot(output) == ItemStack.EMPTY) { + if (getStackInSlot(output).isEmpty()) { return true; } if (!getStackInSlot(output).isItemEqual(itemstack)) { diff --git a/src/main/java/techreborn/tiles/tier1/TileRecycler.java b/src/main/java/techreborn/tiles/tier1/TileRecycler.java index 532c0e0e2..a131390d6 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRecycler.java +++ b/src/main/java/techreborn/tiles/tier1/TileRecycler.java @@ -90,11 +90,11 @@ public class TileRecycler extends TilePowerAcceptor } public boolean canRecycle() { - return getStackInSlot(0) != ItemStack.EMPTY && hasSlotGotSpace(1); + return !getStackInSlot(0) .isEmpty() && hasSlotGotSpace(1); } public boolean hasSlotGotSpace(int slot) { - if (getStackInSlot(slot) == ItemStack.EMPTY) { + if (getStackInSlot(slot).isEmpty()) { return true; } else if (getStackInSlot(slot).getCount() < getStackInSlot(slot).getMaxStackSize()) { return true; diff --git a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java index a029560ad..f14691693 100644 --- a/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/tier1/TileRollingMachine.java @@ -136,7 +136,7 @@ public class TileRollingMachine extends TilePowerAcceptor currentRecipeOutput = RollingMachineRecipe.instance.findMatchingRecipeOutput(craftMatrix, world); if (!currentRecipeOutput.isEmpty()) { boolean hasCrafted = false; - if (inventory.getStackInSlot(outputSlot) == ItemStack.EMPTY) { + if (inventory.getStackInSlot(outputSlot).isEmpty()) { inventory.setInventorySlotContents(outputSlot, currentRecipeOutput); tickTime = 0; hasCrafted = true;