From 0345ada52c4e70bd167c1decc63209c4ef79f3bc Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sat, 13 Aug 2016 09:10:38 +0100 Subject: [PATCH] Remove null checks --- src/main/java/gregtech/GT_Mod.java | 4 ++-- src/main/java/gregtech/api/enums/Dyes.java | 2 +- src/main/java/gregtech/api/enums/Materials.java | 2 +- src/main/java/gregtech/api/enums/OrePrefixes.java | 2 +- .../metatileentity/IMetaTileEntityItemPipe.java | 6 +++--- .../gregtech/api/items/GT_Spray_Hardener_Item.java | 2 +- .../api/metatileentity/BaseMetaTileEntity.java | 2 +- .../api/metatileentity/BaseMetaTileEntityUE.java | 4 ++-- .../api/threads/GT_Runnable_MachineBlockUpdate.java | 4 ++-- src/main/java/gregtech/api/util/GT_PlayedSound.java | 2 +- src/main/java/gregtech/api/util/GT_Utility.java | 12 ++++++------ .../gregtech/common/blocks/GT_Block_Machines.java | 11 +++++------ .../common/blocks/GT_Block_Ores_Abstract.java | 2 +- .../gregtech/common/entities/GT_Entity_Arrow.java | 2 +- .../gregtech/common/items/GT_SensorCard_Item.java | 2 +- .../common/items/behaviors/Behaviour_Wrench.java | 2 +- .../machines/basic/GT_MetaTileEntity_Pump.java | 2 +- .../java/gregtech/loaders/load/GT_ItemIterator.java | 2 +- 18 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 84ccaaed..ecdc899d 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -71,11 +71,11 @@ public class GT_Mod private final String aTextGeneral = "general"; private final String aTextIC2 = "ic2_"; - /*static { + static { if ((509 != GregTech_API.VERSION) || (509 != GT_ModHandler.VERSION) || (509 != GT_OreDictUnificator.VERSION) || (509 != GT_Recipe.VERSION) || (509 != GT_Utility.VERSION) || (509 != GT_RecipeRegistrator.VERSION) || (509 != Element.VERSION) || (509 != Materials.VERSION) || (509 != OrePrefixes.VERSION)) { throw new GT_ItsNotMyFaultException("One of your Mods included GregTech-API Files inside it's download, mention this to the Mod Author, who does this bad thing, and tell him/her to use reflection. I have added a Version check, to prevent Authors from breaking my Mod that way."); } - }*/ + } public GT_Mod() { try { diff --git a/src/main/java/gregtech/api/enums/Dyes.java b/src/main/java/gregtech/api/enums/Dyes.java index 66c39277..c59b310d 100644 --- a/src/main/java/gregtech/api/enums/Dyes.java +++ b/src/main/java/gregtech/api/enums/Dyes.java @@ -64,7 +64,7 @@ public enum Dyes implements IColorModulationContainer { public static Dyes get(String aColor) { Object tObject = GT_Utility.getFieldContent(Dyes.class, aColor, false, false); - if (tObject != null && tObject instanceof Dyes) return (Dyes) tObject; + if (tObject instanceof Dyes) return (Dyes) tObject; return _NULL; } diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 2175e924..f3d4fb1f 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -1393,7 +1393,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { public static Materials get(String aMaterialName) { Object tObject = GT_Utility.getFieldContent(Materials.class, aMaterialName, false, false); - if (tObject != null && tObject instanceof Materials) return (Materials) tObject; + if (tObject instanceof Materials) return (Materials) tObject; return _NULL; } diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 01d3e2d6..fb8bd272 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -638,7 +638,7 @@ public enum OrePrefixes { public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) { Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false); - if (tObject != null && tObject instanceof OrePrefixes) return (OrePrefixes) tObject; + if (tObject instanceof OrePrefixes) return (OrePrefixes) tObject; return aReplacement; } diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java index 510f314d..54f1f484 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java @@ -65,9 +65,9 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { continue; } } - if (tItemPipe != null && tItemPipe instanceof BaseMetaPipeEntity) { + if (tItemPipe instanceof BaseMetaPipeEntity) { IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); - if (tMetaTileEntity != null && tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { + if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsOut(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity); } } @@ -84,7 +84,7 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { } if (tItemPipe instanceof BaseMetaPipeEntity) { IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); - if (tMetaTileEntity != null && tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { + if (tMetaTileEntity instanceof IMetaTileEntityItemPipe && tItemPipe.getCoverBehaviorAtSide(j).letsItemsIn(j, tItemPipe.getCoverIDAtSide(j), tItemPipe.getCoverDataAtSide(j), -2, tItemPipe)) { scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity); } } diff --git a/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java index b9b0b746..926bcc60 100644 --- a/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java +++ b/src/main/java/gregtech/api/items/GT_Spray_Hardener_Item.java @@ -50,7 +50,7 @@ public class GT_Spray_Hardener_Item extends GT_Tool_Item { } ItemStack tStack1 = GT_ModHandler.getIC2Item("constructionFoam", 1), tStack2 = GT_ModHandler.getIC2Item("constructionFoamWall", 1); - if (tStack1 != null && tStack1.isItemEqual(new ItemStack(aBlock)) && tStack2 != null && tStack2.getItem() != null && tStack2.getItem() instanceof ItemBlock) { + if (tStack1 != null && tStack1.isItemEqual(new ItemStack(aBlock)) && tStack2 != null && tStack2.getItem() instanceof ItemBlock) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) { GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack2), 7, 3); diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 9917ca62..03553336 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -397,7 +397,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (getEUCapacity() > 0) { if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); - if (tBlock != null && tBlock instanceof BlockFire) doEnergyExplosion(); + if (tBlock instanceof BlockFire) doEnergyExplosion(); } if (!hasValidMetaTileEntity()) { diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java index 26388bd1..fda019f4 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntityUE.java @@ -75,7 +75,7 @@ public class BaseMetaTileEntityUE extends BaseMetaTileEntity /*implements IUETil for (byte i = 0; i < 6; i++) { if (inputEnergyFrom(i)) { Object tTileEntity = getTileEntityAtSide(i); - if (tTileEntity != null && tTileEntity instanceof IConductor) { + if (tTileEntity instanceof IConductor) { rSides.add(ForgeDirection.getOrientation(i)); } } @@ -88,7 +88,7 @@ public class BaseMetaTileEntityUE extends BaseMetaTileEntity /*implements IUETil for (byte i = 0; i < 6; i++) { if (outputsEnergyTo(i)) { Object tTileEntity = getTileEntityAtSide(i); - if (tTileEntity != null && tTileEntity instanceof IConductor) { + if (tTileEntity instanceof IConductor) { rSides.add(ForgeDirection.getOrientation(i)); } } diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java index 0909229d..92944d3e 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -22,9 +22,9 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList aList) { aList.add(new ChunkPosition(aX, aY, aZ)); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) + if (tTileEntity instanceof IMachineBlockUpdateable) ((IMachineBlockUpdateable) tTileEntity).onMachineBlockUpdate(); - if (aList.size() < 5 || (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) || GregTech_API.isMachineBlock(aWorld.getBlock(aX, aY, aZ), aWorld.getBlockMetadata(aX, aY, aZ))) { + if (aList.size() < 5 || (tTileEntity instanceof IMachineBlockUpdateable) || GregTech_API.isMachineBlock(aWorld.getBlock(aX, aY, aZ), aWorld.getBlockMetadata(aX, aY, aZ))) { if (!aList.contains(new ChunkPosition(aX + 1, aY, aZ))) stepToUpdateMachine(aWorld, aX + 1, aY, aZ, aList); if (!aList.contains(new ChunkPosition(aX - 1, aY, aZ))) stepToUpdateMachine(aWorld, aX - 1, aY, aZ, aList); if (!aList.contains(new ChunkPosition(aX, aY + 1, aZ))) stepToUpdateMachine(aWorld, aX, aY + 1, aZ, aList); diff --git a/src/main/java/gregtech/api/util/GT_PlayedSound.java b/src/main/java/gregtech/api/util/GT_PlayedSound.java index 858f3b82..136171f7 100644 --- a/src/main/java/gregtech/api/util/GT_PlayedSound.java +++ b/src/main/java/gregtech/api/util/GT_PlayedSound.java @@ -15,7 +15,7 @@ public class GT_PlayedSound { @Override public boolean equals(Object aObject) { - if (aObject != null && aObject instanceof GT_PlayedSound) { + if (aObject instanceof GT_PlayedSound) { return ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY && ((GT_PlayedSound) aObject).mZ == mZ && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName); } return false; diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 29a454bc..43749419 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -319,7 +319,7 @@ public class GT_Utility { } public static void sendChatToPlayer(EntityPlayer aPlayer, String aChatMessage) { - if (aPlayer != null && aPlayer instanceof EntityPlayerMP && aChatMessage != null) { + if (aPlayer instanceof EntityPlayerMP && aChatMessage != null) { aPlayer.addChatComponentMessage(new ChatComponentText(aChatMessage)); } } @@ -500,7 +500,7 @@ public class GT_Utility { * @return the Amount of moved Items */ public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, List aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { - if (aTileEntity1 != null && aTileEntity1 instanceof IInventory) + if (aTileEntity1 instanceof IInventory) return moveOneItemStack((IInventory) aTileEntity1, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, true); return 0; } @@ -597,7 +597,7 @@ public class GT_Utility { for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; } - if (aTileEntity2 != null && aTileEntity2 instanceof IInventory) { + if (aTileEntity2 instanceof IInventory) { for (int i = 0; i < tGrabSlots.length; i++) { if (listContainsItem(aFilter, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlots[i]), true, aInvertFilter)) { if (isAllowedToTakeFromSlot((IInventory) aTileEntity1, tGrabSlots[i], aGrabFrom, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlots[i]))) { @@ -1010,7 +1010,7 @@ public class GT_Utility { } public static boolean isBlockValid(Object aBlock) { - return aBlock != null && (aBlock instanceof Block); + return (aBlock instanceof Block); } public static boolean isBlockInvalid(Object aBlock) { @@ -1026,7 +1026,7 @@ public class GT_Utility { } public static boolean isStackValid(Object aStack) { - return aStack != null && (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null && ((ItemStack) aStack).stackSize >= 0; + return (aStack instanceof ItemStack) && ((ItemStack) aStack).getItem() != null && ((ItemStack) aStack).stackSize >= 0; } public static boolean isStackInvalid(Object aStack) { @@ -1558,7 +1558,7 @@ public class GT_Utility { tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----"); try { - if (tTileEntity != null && tTileEntity instanceof IInventory) + if (tTileEntity instanceof IInventory) tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); else tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index bc193668..85afcf5e 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -282,8 +282,7 @@ public class GT_Block_Machines public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && - ((tTileEntity instanceof IGregTechTileEntity))) { + if (((tTileEntity instanceof IGregTechTileEntity))) { ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer); } } @@ -341,7 +340,7 @@ public class GT_Block_Machines public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { + if (((tTileEntity instanceof IGregTechTileEntity))) { return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide); } return 0; @@ -352,7 +351,7 @@ public class GT_Block_Machines return 0; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { + if (((tTileEntity instanceof IGregTechTileEntity))) { return ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); } return 0; @@ -363,7 +362,7 @@ public class GT_Block_Machines return 0; } TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { + if (((tTileEntity instanceof IGregTechTileEntity))) { return ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)); } return 0; @@ -429,7 +428,7 @@ public class GT_Block_Machines public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { + if (((tTileEntity instanceof IGregTechTileEntity))) { return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); } return 10.0F; diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index cfbcb6ab..6cc77cd2 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -201,7 +201,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public int getDamageValue(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity != null) && ((tTileEntity instanceof GT_TileEntity_Ores))) { + if (((tTileEntity instanceof GT_TileEntity_Ores))) { return ((GT_TileEntity_Ores) tTileEntity).getMetaData(); } return 0; diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java index 778ca13e..a9572013 100644 --- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java +++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java @@ -128,7 +128,7 @@ public class GT_Entity_Arrow if (tHitEntity != null) { tVector = new MovingObjectPosition(tHitEntity); } - if ((tVector != null) && (tVector.entityHit != null) && ((tVector.entityHit instanceof EntityPlayer))) { + if ((tVector != null) && ((tVector.entityHit instanceof EntityPlayer))) { EntityPlayer entityplayer = (EntityPlayer) tVector.entityHit; if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) { tVector = null; diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java index 28472ed4..68743e79 100644 --- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java +++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java @@ -53,7 +53,7 @@ public class GT_SensorCard_Item ChunkCoordinates target = aCard.getTarget(); TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ); - if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { + if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData(); for (int i = 0; i < tInfoData.length; i++) { aCard.setString("mString" + i, tInfoData[i]); diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java index d8c42232..f111e9f0 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Wrench.java @@ -40,7 +40,7 @@ public class Behaviour_Wrench byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ); TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); try { - if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) { + if (((aTileEntity instanceof IWrenchable))) { if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IWrenchable) aTileEntity).setFacing((short) aTargetSide); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java index 6aabea82..25912f24 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Pump.java @@ -115,7 +115,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch { this.mPumpCountBelow = 0; IGregTechTileEntity tTileEntity; for (int i = 1; (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null) - && (tTileEntity.getMetaTileEntity() != null) && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) { + && ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Pump)); i++) { getBaseMetaTileEntity().setActive(tTileEntity.isActive()); this.mPumpCountBelow += 1; ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1; diff --git a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java index 651b8e86..81847f25 100644 --- a/src/main/java/gregtech/loaders/load/GT_ItemIterator.java +++ b/src/main/java/gregtech/loaders/load/GT_ItemIterator.java @@ -57,7 +57,7 @@ public class GT_ItemIterator Iterator tIterator = Item.itemRegistry.iterator(); while (tIterator.hasNext()) { Object tObject; - if (((tObject = tIterator.next()) != null) && ((tObject instanceof Item)) && (!(tObject instanceof GT_Generic_Item))) { + if (((tObject = tIterator.next()) instanceof Item) && (!(tObject instanceof GT_Generic_Item))) { Item tItem = (Item) tObject; String tName; if ((tName = tItem.getUnlocalizedName()) != null) {