diff --git a/src/main/java/techreborn/blocks/BlockDigitalChest.java b/src/main/java/techreborn/blocks/BlockDigitalChest.java index 8ac85787b..d8fc5c7f3 100644 --- a/src/main/java/techreborn/blocks/BlockDigitalChest.java +++ b/src/main/java/techreborn/blocks/BlockDigitalChest.java @@ -76,10 +76,10 @@ public class BlockDigitalChest extends BlockMachineBase { for (int i = 0; i < droppables.size(); i++) { final ItemStack itemStack = droppables.get(i); - if (itemStack == ItemStack.EMPTY) { + if (itemStack.isEmpty()) { continue; } - if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) { + if (!itemStack.isEmpty() && itemStack.getCount() > 0) { if (itemStack.getItem() instanceof ItemBlock) { if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid diff --git a/src/main/java/techreborn/blocks/BlockQuantumChest.java b/src/main/java/techreborn/blocks/BlockQuantumChest.java index c786e9951..b5453e4a9 100644 --- a/src/main/java/techreborn/blocks/BlockQuantumChest.java +++ b/src/main/java/techreborn/blocks/BlockQuantumChest.java @@ -80,10 +80,10 @@ public class BlockQuantumChest extends BlockMachineBase { for (int i = 0; i < droppables.size(); i++) { final ItemStack itemStack = droppables.get(i); - if (itemStack == ItemStack.EMPTY) { + if (itemStack.isEmpty()) { continue; } - if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) { + if (!itemStack.isEmpty() && itemStack.getCount() > 0) { if (itemStack.getItem() instanceof ItemBlock) { if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid diff --git a/src/main/java/techreborn/blocks/BlockRubberLog.java b/src/main/java/techreborn/blocks/BlockRubberLog.java index f5873074b..a496d7144 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLog.java +++ b/src/main/java/techreborn/blocks/BlockRubberLog.java @@ -158,7 +158,7 @@ public class BlockRubberLog extends Block { EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ); ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND); - if (stack != ItemStack.EMPTY) + if (!stack.isEmpty()) if ((stack.getItem() instanceof ItemElectricTreetap && PoweredItem.canUseEnergy(20, stack)) || stack.getItem() instanceof ItemTreeTap) if (state.getValue(HAS_SAP)) { if (state.getValue(SAP_SIDE) == side) { diff --git a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java index 50df2a4d1..b3fc6068f 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockTransformer.java @@ -140,10 +140,10 @@ public abstract class BlockTransformer extends BaseTileBlock { for (int i = 0; i < inventory.getSizeInventory(); i++) { ItemStack itemStack = inventory.getStackInSlot(i); - if (itemStack == ItemStack.EMPTY) { + if (itemStack.isEmpty()) { continue; } - if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) { + if (!itemStack.isEmpty() && itemStack.getCount() > 0) { if (itemStack.getItem() instanceof ItemBlock) { if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid diff --git a/src/main/java/techreborn/client/container/builder/BuiltContainer.java b/src/main/java/techreborn/client/container/builder/BuiltContainer.java index 65761c5cf..a1d56bc73 100644 --- a/src/main/java/techreborn/client/container/builder/BuiltContainer.java +++ b/src/main/java/techreborn/client/container/builder/BuiltContainer.java @@ -232,6 +232,8 @@ public class BuiltContainer extends Container { slot.onTake(player, stackInSlot); } return originalStack; + + } protected boolean shiftItemStack(final ItemStack stackToShift, final int start, final int end) { @@ -240,7 +242,7 @@ public class BuiltContainer extends Container { for (int slotIndex = start; stackToShift.getCount() > 0 && slotIndex < end; slotIndex++) { final Slot slot = this.inventorySlots.get(slotIndex); final ItemStack stackInSlot = slot.getStack(); - if (stackInSlot != ItemStack.EMPTY && ItemUtils.isItemEqual(stackInSlot, stackToShift, true, true) + if (!stackInSlot.isEmpty() && ItemUtils.isItemEqual(stackInSlot, stackToShift, true, true) && slot.isItemValid(stackToShift)) { final int resultingStackSize = stackInSlot.getCount() + stackToShift.getCount(); final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); @@ -262,7 +264,7 @@ public class BuiltContainer extends Container { for (int slotIndex = start; stackToShift.getCount() > 0 && slotIndex < end; slotIndex++) { final Slot slot = this.inventorySlots.get(slotIndex); ItemStack stackInSlot = slot.getStack(); - if (stackInSlot == ItemStack.EMPTY && slot.isItemValid(stackToShift)) { + if (stackInSlot.isEmpty() && slot.isItemValid(stackToShift)) { final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); stackInSlot = stackToShift.copy(); stackInSlot.setCount(Math.min(stackToShift.getCount(), max)); diff --git a/src/main/java/techreborn/client/gui/GuiDigitalChest.java b/src/main/java/techreborn/client/gui/GuiDigitalChest.java index 5c02b2eb0..e98bc1c6c 100644 --- a/src/main/java/techreborn/client/gui/GuiDigitalChest.java +++ b/src/main/java/techreborn/client/gui/GuiDigitalChest.java @@ -51,12 +51,12 @@ public class GuiDigitalChest extends GuiBase { super.drawGuiContainerForegroundLayer(mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) { + if (!this.digitalChest.storedItem.isEmpty() && this.digitalChest.getStackInSlot(1) != null) { this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(), this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); } - if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) { + if (this.digitalChest.storedItem.isEmpty() && this.digitalChest.getStackInSlot(1) != null) { this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(), this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); } diff --git a/src/main/java/techreborn/client/gui/GuiQuantumChest.java b/src/main/java/techreborn/client/gui/GuiQuantumChest.java index 3c976cb8a..ff48e6161 100644 --- a/src/main/java/techreborn/client/gui/GuiQuantumChest.java +++ b/src/main/java/techreborn/client/gui/GuiQuantumChest.java @@ -51,10 +51,10 @@ public class GuiQuantumChest extends GuiBase { super.drawGuiContainerForegroundLayer(mouseX, mouseY); final Layer layer = Layer.FOREGROUND; - if (this.quantumChest.storedItem != ItemStack.EMPTY && this.quantumChest.getStackInSlot(1) != null) { + if (!this.quantumChest.storedItem.isEmpty() && this.quantumChest.getStackInSlot(1) != null) { this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.storedItem.getCount() + this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); } - if (this.quantumChest.storedItem == ItemStack.EMPTY && this.quantumChest.getStackInSlot(1) != null) { + if (this.quantumChest.storedItem.isEmpty() && this.quantumChest.getStackInSlot(1) != null) { this.builder.drawBigBlueBar(this, 31, 43, this.quantumChest.getStackInSlot(1).getCount(), this.quantumChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); } } diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 44d84f62b..0e2745a1d 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -213,13 +213,13 @@ public class ModRecipes { data[1].equals("aluminium") || data[1].equals("iridium") || data[1].equals("saltpeter")) || - oreStack == ItemStack.EMPTY) + oreStack.isEmpty()) continue; boolean ore = data[0].equals("ore"); Core.logHelper.debug("Ore: " + data[1]); ItemStack dust = getDictOreOrEmpty(joinDictName("dust", data[1]), ore ? 2 : 1); - if (dust == ItemStack.EMPTY || dust.getItem() == null) { + if (dust.isEmpty() || dust.getItem() == null) { continue; } dust = dust.copy(); diff --git a/src/main/java/techreborn/itemblocks/ItemBlockAdjustableSU.java b/src/main/java/techreborn/itemblocks/ItemBlockAdjustableSU.java index 4306f573f..442e89f16 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockAdjustableSU.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockAdjustableSU.java @@ -54,7 +54,7 @@ public class ItemBlockAdjustableSU extends ItemBlock { @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) { - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { if (stack.getTagCompound().getCompoundTag("tileEntity") != null) list.add(PowerSystem .getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("energy"))); @@ -72,7 +72,7 @@ public class ItemBlockAdjustableSU extends ItemBlock { // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, // y, z, metadata); } - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { ((TileAdjustableSU) world.getTileEntity(pos)) .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java b/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java index 386ea1b67..190fa231d 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java @@ -49,7 +49,7 @@ public class ItemBlockDigitalChest extends ItemBlock { @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) { - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { if (stack.getTagCompound().getCompoundTag("tileEntity") != null) list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items"); } @@ -66,7 +66,7 @@ public class ItemBlockDigitalChest extends ItemBlock { // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, // y, z, metadata); } - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { ((TileDigitalChest) world.getTileEntity(pos)) .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java b/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java index 58b8c5dee..4ec29920f 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java @@ -49,7 +49,7 @@ public class ItemBlockQuantumChest extends ItemBlock { @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) { - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { if (stack.getTagCompound().getCompoundTag("tileEntity") != null) list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items"); } @@ -66,7 +66,7 @@ public class ItemBlockQuantumChest extends ItemBlock { // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, // y, z, metadata); } - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { ((TileQuantumChest) world.getTileEntity(pos)) .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java b/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java index d473bf3e3..0af4ba560 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java @@ -51,7 +51,7 @@ public class ItemBlockQuantumTank extends ItemBlock { // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, // y, z, metadata); } - if (stack != ItemStack.EMPTY && stack.hasTagCompound()) { + if (!stack.isEmpty() && stack.hasTagCompound()) { ((TileQuantumTank) world.getTileEntity(pos)) .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); } diff --git a/src/main/java/techreborn/items/ItemFrequencyTransmitter.java b/src/main/java/techreborn/items/ItemFrequencyTransmitter.java index 3a511b0d6..4435dbd57 100644 --- a/src/main/java/techreborn/items/ItemFrequencyTransmitter.java +++ b/src/main/java/techreborn/items/ItemFrequencyTransmitter.java @@ -61,7 +61,7 @@ public class ItemFrequencyTransmitter extends ItemTR { World worldIn, @Nullable EntityLivingBase entityIn) { - if (stack != ItemStack.EMPTY && stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) { + if (!stack.isEmpty() && stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) { return 1.0F; } return 0.0F; diff --git a/src/main/java/techreborn/items/battery/ItemBattery.java b/src/main/java/techreborn/items/battery/ItemBattery.java index 9c7d9a2bb..6e9b3b62f 100644 --- a/src/main/java/techreborn/items/battery/ItemBattery.java +++ b/src/main/java/techreborn/items/battery/ItemBattery.java @@ -63,7 +63,7 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter World worldIn, @Nullable EntityLivingBase entityIn) { - if (stack != ItemStack.EMPTY && PoweredItem.getEnergy(stack) == 0.0) { + if (!stack.isEmpty() && PoweredItem.getEnergy(stack) == 0.0) { return 1.0F; } return 0.0F; diff --git a/src/main/java/techreborn/items/tools/ItemChainsaw.java b/src/main/java/techreborn/items/tools/ItemChainsaw.java index 05950100c..4ace2b160 100644 --- a/src/main/java/techreborn/items/tools/ItemChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemChainsaw.java @@ -74,7 +74,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt World worldIn, @Nullable EntityLivingBase entityIn) { - if (stack != ItemStack.EMPTY && PoweredItem.canUseEnergy(cost, stack) && entityIn != null && entityIn.getHeldItemMainhand().equals(stack)) { + if (!stack.isEmpty() && PoweredItem.canUseEnergy(cost, stack) && entityIn != null && entityIn.getHeldItemMainhand().equals(stack)) { return 1.0F; } return 0.0F; diff --git a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java index 3431d31c0..3edb08408 100644 --- a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java +++ b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java @@ -102,7 +102,7 @@ public class ItemCloakingDevice extends ItemTR implements IEnergyItemInfo, IEner public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { ItemStack itemstack1 = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); - if (itemstack1 == ItemStack.EMPTY) { + if (itemstack1.isEmpty()) { player.setItemStackToSlot(EntityEquipmentSlot.CHEST, itemStack.copy()); itemStack.setCount(0); } diff --git a/src/main/java/techreborn/items/tools/ItemNanosaber.java b/src/main/java/techreborn/items/tools/ItemNanosaber.java index af0c00cf9..458d06528 100644 --- a/src/main/java/techreborn/items/tools/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tools/ItemNanosaber.java @@ -74,7 +74,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy World worldIn, @Nullable EntityLivingBase entityIn) { - if (stack != ItemStack.EMPTY && stack.hasTagCompound() && stack.getTagCompound().hasKey("isActive") && stack.getTagCompound().getBoolean("isActive")) { + if (!stack.isEmpty() && stack.hasTagCompound() && stack.getTagCompound().hasKey("isActive") && stack.getTagCompound().getBoolean("isActive")) { if (PoweredItem.getMaxPower(stack) - PoweredItem.getEnergy(stack) >= 0.9 * PoweredItem.getMaxPower(stack)) return 0.5F; return 1.0F; diff --git a/src/main/java/techreborn/tiles/TileIronAlloyFurnace.java b/src/main/java/techreborn/tiles/TileIronAlloyFurnace.java index 5b5b77dd9..29a930a25 100644 --- a/src/main/java/techreborn/tiles/TileIronAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/TileIronAlloyFurnace.java @@ -221,7 +221,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase itemstack = recipeType.getOutput(0); break; } - if (itemstack != ItemStack.EMPTY) { + if (!itemstack.isEmpty()) { break; } } diff --git a/src/main/java/techreborn/tiles/TileIronFurnace.java b/src/main/java/techreborn/tiles/TileIronFurnace.java index fe1ccd90a..1ce229699 100644 --- a/src/main/java/techreborn/tiles/TileIronFurnace.java +++ b/src/main/java/techreborn/tiles/TileIronFurnace.java @@ -135,7 +135,7 @@ public class TileIronFurnace extends TileLegacyMachineBase if (this.getStackInSlot(this.input1) == ItemStack.EMPTY) return false; final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.getStackInSlot(this.input1)); - if (itemstack == ItemStack.EMPTY) + if (itemstack.isEmpty()) return false; if (this.getStackInSlot(this.output) == ItemStack.EMPTY) return true; @@ -151,7 +151,7 @@ public class TileIronFurnace extends TileLegacyMachineBase public ItemStack getResultFor(final ItemStack stack) { final ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); - if (result != ItemStack.EMPTY) { + if (!result.isEmpty()) { return result.copy(); } return ItemStack.EMPTY; diff --git a/src/main/java/techreborn/tiles/TileTechStorageBase.java b/src/main/java/techreborn/tiles/TileTechStorageBase.java index 258425a21..02b6dd3f2 100644 --- a/src/main/java/techreborn/tiles/TileTechStorageBase.java +++ b/src/main/java/techreborn/tiles/TileTechStorageBase.java @@ -76,7 +76,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase } } - if (this.storedItem != ItemStack.EMPTY) { + if (!this.storedItem.isEmpty()) { if (this.getStackInSlot(1) == ItemStack.EMPTY) { ItemStack delivered = this.storedItem.copy(); @@ -127,7 +127,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase storedItem = new ItemStack((NBTTagCompound) tagCompound.getTag("storedStack")); } - if (storedItem != ItemStack.EMPTY) { + if (!storedItem.isEmpty()) { storedItem.setCount(tagCompound.getInteger("storedQuantity")); } } @@ -140,7 +140,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase } public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) { - if (storedItem != ItemStack.EMPTY) { + if (!storedItem.isEmpty()) { tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound())); tagCompound.setInteger("storedQuantity", storedItem.getCount()); } else { @@ -237,7 +237,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase if (isRealTile) { int size = 0; String name = "of nothing"; - if (storedItem != ItemStack.EMPTY) { + if (!storedItem.isEmpty()) { name = storedItem.getDisplayName(); size += storedItem.getCount(); } diff --git a/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java b/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java index 14599d945..d9cbd1137 100644 --- a/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java +++ b/src/main/java/techreborn/tiles/fusionReactor/TileFusionControlComputer.java @@ -287,7 +287,7 @@ public class TileFusionControlComputer extends TilePowerAcceptor implements IInv } public boolean canFitStack(final ItemStack stack, final int slot, final boolean oreDic) {// Checks to see if it can fit the stack - if (stack == ItemStack.EMPTY) { + if (stack.isEmpty()) { return true; } if (this.inventory.getStackInSlot(slot) == ItemStack.EMPTY) { diff --git a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java index 488a59c52..2ea5f1bf0 100644 --- a/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java +++ b/src/main/java/techreborn/tiles/multiblock/TileIndustrialSawmill.java @@ -146,7 +146,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor public boolean canAddOutput(final int slot, final int amount) { final ItemStack stack = this.getStackInSlot(slot); - return stack == ItemStack.EMPTY || this.getInventoryStackLimit() - stack.getCount() >= amount; + return stack.isEmpty() || this.getInventoryStackLimit() - stack.getCount() >= amount; } @Override diff --git a/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java index 63c17f5cb..496f6fc6d 100644 --- a/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java +++ b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java @@ -113,7 +113,7 @@ public class TileElectricFurnace extends TilePowerAcceptor return false; } final ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.getStackInSlot(this.input1)); - if (itemstack == ItemStack.EMPTY) + if (itemstack.isEmpty()) return false; if (this.getStackInSlot(this.output) == ItemStack.EMPTY) return true; @@ -129,7 +129,7 @@ public class TileElectricFurnace extends TilePowerAcceptor public ItemStack getResultFor(final ItemStack stack) { final ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); - if (result != ItemStack.EMPTY) { + if (!result.isEmpty()) { return result.copy(); } return ItemStack.EMPTY; diff --git a/src/main/java/techreborn/utils/OreDictUtils.java b/src/main/java/techreborn/utils/OreDictUtils.java index 25d6a2891..999c52b42 100644 --- a/src/main/java/techreborn/utils/OreDictUtils.java +++ b/src/main/java/techreborn/utils/OreDictUtils.java @@ -106,7 +106,7 @@ public class OreDictUtils { public static boolean isOre( @Nonnull ItemStack stack, String oreName) { - if (stack != ItemStack.EMPTY && !stack.isEmpty() && oreName != null) { + if (!stack.isEmpty() && !stack.isEmpty() && oreName != null) { int id = OreDictionary.getOreID(oreName); int[] ids = OreDictionary.getOreIDs(stack);