Remove null checks

This commit is contained in:
Muramasa 2016-08-13 09:10:38 +01:00
parent 9ca24419fb
commit 0345ada52c
18 changed files with 32 additions and 33 deletions

View file

@ -71,11 +71,11 @@ public class GT_Mod
private final String aTextGeneral = "general"; private final String aTextGeneral = "general";
private final String aTextIC2 = "ic2_"; 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)) { 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."); 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() { public GT_Mod() {
try { try {

View file

@ -64,7 +64,7 @@ public enum Dyes implements IColorModulationContainer {
public static Dyes get(String aColor) { public static Dyes get(String aColor) {
Object tObject = GT_Utility.getFieldContent(Dyes.class, aColor, false, false); 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; return _NULL;
} }

View file

@ -1393,7 +1393,7 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
public static Materials get(String aMaterialName) { public static Materials get(String aMaterialName) {
Object tObject = GT_Utility.getFieldContent(Materials.class, aMaterialName, false, false); 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; return _NULL;
} }

View file

@ -638,7 +638,7 @@ public enum OrePrefixes {
public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) { public static OrePrefixes getPrefix(String aPrefixName, OrePrefixes aReplacement) {
Object tObject = GT_Utility.getFieldContent(OrePrefixes.class, aPrefixName, false, false); 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; return aReplacement;
} }

View file

@ -65,9 +65,9 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
continue; continue;
} }
} }
if (tItemPipe != null && tItemPipe instanceof BaseMetaPipeEntity) { if (tItemPipe instanceof BaseMetaPipeEntity) {
IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); 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); scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
} }
} }
@ -84,7 +84,7 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity {
} }
if (tItemPipe instanceof BaseMetaPipeEntity) { if (tItemPipe instanceof BaseMetaPipeEntity) {
IMetaTileEntity tMetaTileEntity = tItemPipe.getMetaTileEntity(); 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); scanPipes((IMetaTileEntityItemPipe) tMetaTileEntity, aMap, aStep, aSuckItems, aIgnoreCapacity);
} }
} }

View file

@ -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); 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)) { if (GT_ModHandler.damageOrDechargeItem(aStack, 1, 1000, aPlayer)) {
GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(102), 1.0F, -1, aX, aY, aZ); 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); aWorld.setBlock(aX, aY, aZ, GT_Utility.getBlockFromStack(tStack2), 7, 3);

View file

@ -397,7 +397,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
if (getEUCapacity() > 0) { if (getEUCapacity() > 0) {
if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) { if (GregTech_API.sMachineFireExplosions && getRandomNumber(1000) == 0) {
Block tBlock = getBlockAtSide((byte) getRandomNumber(6)); Block tBlock = getBlockAtSide((byte) getRandomNumber(6));
if (tBlock != null && tBlock instanceof BlockFire) doEnergyExplosion(); if (tBlock instanceof BlockFire) doEnergyExplosion();
} }
if (!hasValidMetaTileEntity()) { if (!hasValidMetaTileEntity()) {

View file

@ -75,7 +75,7 @@ public class BaseMetaTileEntityUE extends BaseMetaTileEntity /*implements IUETil
for (byte i = 0; i < 6; i++) { for (byte i = 0; i < 6; i++) {
if (inputEnergyFrom(i)) { if (inputEnergyFrom(i)) {
Object tTileEntity = getTileEntityAtSide(i); Object tTileEntity = getTileEntityAtSide(i);
if (tTileEntity != null && tTileEntity instanceof IConductor) { if (tTileEntity instanceof IConductor) {
rSides.add(ForgeDirection.getOrientation(i)); rSides.add(ForgeDirection.getOrientation(i));
} }
} }
@ -88,7 +88,7 @@ public class BaseMetaTileEntityUE extends BaseMetaTileEntity /*implements IUETil
for (byte i = 0; i < 6; i++) { for (byte i = 0; i < 6; i++) {
if (outputsEnergyTo(i)) { if (outputsEnergyTo(i)) {
Object tTileEntity = getTileEntityAtSide(i); Object tTileEntity = getTileEntityAtSide(i);
if (tTileEntity != null && tTileEntity instanceof IConductor) { if (tTileEntity instanceof IConductor) {
rSides.add(ForgeDirection.getOrientation(i)); rSides.add(ForgeDirection.getOrientation(i));
} }
} }

View file

@ -22,9 +22,9 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable {
private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList<ChunkPosition> aList) { private static void stepToUpdateMachine(World aWorld, int aX, int aY, int aZ, ArrayList<ChunkPosition> aList) {
aList.add(new ChunkPosition(aX, aY, aZ)); aList.add(new ChunkPosition(aX, aY, aZ));
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (tTileEntity != null && tTileEntity instanceof IMachineBlockUpdateable) if (tTileEntity instanceof IMachineBlockUpdateable)
((IMachineBlockUpdateable) tTileEntity).onMachineBlockUpdate(); ((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 - 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); if (!aList.contains(new ChunkPosition(aX, aY + 1, aZ))) stepToUpdateMachine(aWorld, aX, aY + 1, aZ, aList);

View file

@ -15,7 +15,7 @@ public class GT_PlayedSound {
@Override @Override
public boolean equals(Object aObject) { 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 ((GT_PlayedSound) aObject).mX == mX && ((GT_PlayedSound) aObject).mY == mY && ((GT_PlayedSound) aObject).mZ == mZ && ((GT_PlayedSound) aObject).mSoundName.equals(mSoundName);
} }
return false; return false;

View file

@ -319,7 +319,7 @@ public class GT_Utility {
} }
public static void sendChatToPlayer(EntityPlayer aPlayer, String aChatMessage) { 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)); aPlayer.addChatComponentMessage(new ChatComponentText(aChatMessage));
} }
} }
@ -500,7 +500,7 @@ public class GT_Utility {
* @return the Amount of moved Items * @return the Amount of moved Items
*/ */
public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, List<ItemStack> aFilter, boolean aInvertFilter, byte aMaxTargetStackSize, byte aMinTargetStackSize, byte aMaxMoveAtOnce, byte aMinMoveAtOnce) { public static byte moveOneItemStack(Object aTileEntity1, Object aTileEntity2, byte aGrabFrom, byte aPutTo, List<ItemStack> 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 moveOneItemStack((IInventory) aTileEntity1, aTileEntity2, aGrabFrom, aPutTo, aFilter, aInvertFilter, aMaxTargetStackSize, aMinTargetStackSize, aMaxMoveAtOnce, aMinMoveAtOnce, true);
return 0; return 0;
} }
@ -597,7 +597,7 @@ public class GT_Utility {
for (int i = 0; i < tGrabSlots.length; i++) tGrabSlots[i] = i; 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++) { for (int i = 0; i < tGrabSlots.length; i++) {
if (listContainsItem(aFilter, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlots[i]), true, aInvertFilter)) { if (listContainsItem(aFilter, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlots[i]), true, aInvertFilter)) {
if (isAllowedToTakeFromSlot((IInventory) aTileEntity1, tGrabSlots[i], aGrabFrom, ((IInventory) aTileEntity1).getStackInSlot(tGrabSlots[i]))) { 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) { public static boolean isBlockValid(Object aBlock) {
return aBlock != null && (aBlock instanceof Block); return (aBlock instanceof Block);
} }
public static boolean isBlockInvalid(Object aBlock) { public static boolean isBlockInvalid(Object aBlock) {
@ -1026,7 +1026,7 @@ public class GT_Utility {
} }
public static boolean isStackValid(Object aStack) { 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) { public static boolean isStackInvalid(Object aStack) {
@ -1558,7 +1558,7 @@ public class GT_Utility {
tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----"); tList.add("----- X: " + aX + " Y: " + aY + " Z: " + aZ + " -----");
try { try {
if (tTileEntity != null && tTileEntity instanceof IInventory) if (tTileEntity instanceof IInventory)
tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); tList.add("Name: " + ((IInventory) tTileEntity).getInventoryName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ));
else else
tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ)); tList.add("Name: " + tBlock.getUnlocalizedName() + " MetaData: " + aWorld.getBlockMetadata(aX, aY, aZ));

View file

@ -282,8 +282,7 @@ public class GT_Block_Machines
public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity != null) && if (((tTileEntity instanceof IGregTechTileEntity))) {
((tTileEntity instanceof IGregTechTileEntity))) {
((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer); ((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) { public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide); return ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide);
} }
return 0; return 0;
@ -352,7 +351,7 @@ public class GT_Block_Machines
return 0; return 0;
} }
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); 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 ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
} }
return 0; return 0;
@ -363,7 +362,7 @@ public class GT_Block_Machines
return 0; return 0;
} }
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); 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 ((IGregTechTileEntity) tTileEntity).getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide));
} }
return 0; 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) { 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); TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if ((tTileEntity != null) && ((tTileEntity instanceof IGregTechTileEntity))) { if (((tTileEntity instanceof IGregTechTileEntity))) {
return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6); return ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6);
} }
return 10.0F; return 10.0F;

View file

@ -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) { public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, 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 ((GT_TileEntity_Ores) tTileEntity).getMetaData();
} }
return 0; return 0;

View file

@ -128,7 +128,7 @@ public class GT_Entity_Arrow
if (tHitEntity != null) { if (tHitEntity != null) {
tVector = new MovingObjectPosition(tHitEntity); 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; EntityPlayer entityplayer = (EntityPlayer) tVector.entityHit;
if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) { if ((entityplayer.capabilities.disableDamage) || (((tShootingEntity instanceof EntityPlayer)) && (!((EntityPlayer) tShootingEntity).canAttackPlayer(entityplayer)))) {
tVector = null; tVector = null;

View file

@ -53,7 +53,7 @@ public class GT_SensorCard_Item
ChunkCoordinates target = aCard.getTarget(); ChunkCoordinates target = aCard.getTarget();
TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ); 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(); String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData();
for (int i = 0; i < tInfoData.length; i++) { for (int i = 0; i < tInfoData.length; i++) {
aCard.setString("mString" + i, tInfoData[i]); aCard.setString("mString" + i, tInfoData[i]);

View file

@ -40,7 +40,7 @@ public class Behaviour_Wrench
byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ); byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ);
TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ);
try { try {
if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) { if (((aTileEntity instanceof IWrenchable))) {
if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) {
if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) {
((IWrenchable) aTileEntity).setFacing((short) aTargetSide); ((IWrenchable) aTileEntity).setFacing((short) aTargetSide);

View file

@ -115,7 +115,7 @@ public class GT_MetaTileEntity_Pump extends GT_MetaTileEntity_Hatch {
this.mPumpCountBelow = 0; this.mPumpCountBelow = 0;
IGregTechTileEntity tTileEntity; IGregTechTileEntity tTileEntity;
for (int i = 1; (i < 21) && ((tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance((byte) 0, i)) != null) 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()); getBaseMetaTileEntity().setActive(tTileEntity.isActive());
this.mPumpCountBelow += 1; this.mPumpCountBelow += 1;
((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1; ((GT_MetaTileEntity_Pump) tTileEntity.getMetaTileEntity()).mPumpTimer -= 1;

View file

@ -57,7 +57,7 @@ public class GT_ItemIterator
Iterator tIterator = Item.itemRegistry.iterator(); Iterator tIterator = Item.itemRegistry.iterator();
while (tIterator.hasNext()) { while (tIterator.hasNext()) {
Object tObject; 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; Item tItem = (Item) tObject;
String tName; String tName;
if ((tName = tItem.getUnlocalizedName()) != null) { if ((tName = tItem.getUnlocalizedName()) != null) {