diff options
17 files changed, 49 insertions, 47 deletions
diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java index 01091d84e3..b41745c660 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandMath.java +++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java @@ -88,11 +88,11 @@ public class CommandMath implements ICommand ChunkCoordinates Y = null; Utils.LOG_WARNING("Bed Location: "+Y); try { - if (P.getBedLocation(0).equals(null)){ + if (P.getBedLocation(0) == null){ Y = W.getSpawnPoint(); Utils.LOG_WARNING("Spawn Location: "+Y); } - else if (!P.getBedLocation(0).equals(null)){ + else if (P.getBedLocation(0) != null){ Y = P.getBedLocation(0); Utils.LOG_WARNING("Bed Location: "+Y); } @@ -104,7 +104,7 @@ public class CommandMath implements ICommand catch(NullPointerException e) { PlayerUtils.messagePlayer(P, "You do not have a spawn, so..."); } - if (Y == null || Y.equals(null)) { + if (Y == null) { Y = W.getSpawnPoint(); Utils.LOG_WARNING("Spawn Location: "+Y); } diff --git a/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java index 1475c98a66..7d7a40c356 100644 --- a/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java @@ -20,7 +20,7 @@ public class PickaxeBlockBreakEventHandler { public void onBreakBlock(BreakEvent event) { try{ TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); - if (entity != null && !entity.equals(null)){ + if (entity != null){ EntityPlayer playerInternal = event.getPlayer(); Utils.LOG_WARNING(entity.getClass().getSimpleName()); if (entity.getClass().getSimpleName().equals("")){ diff --git a/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java index fcda57aa93..559301f4f0 100644 --- a/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java +++ b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java @@ -60,7 +60,7 @@ public class UnbreakableBlockManager{ private static void innerInvincible(GregtechMetaSafeBlock MetaSafeBlock, TileEntity entity, World TE_WORLD, /*EntityPlayer aPlayer,*/ int X, int Y, int Z){ - if (entity != null && !entity.equals(null)){ + if (entity != null){ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable); Utils.LOG_WARNING("Grabbed TE: "+entity.toString()); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index bab4bfeded..eb5694f1a9 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -79,8 +79,9 @@ public class BaseItemComponent extends Item{ @Override public String getItemStackDisplayName(ItemStack p_77653_1_) { - if (componentMaterial != null) + if (componentMaterial != null) { return (componentMaterial.getLocalizedName()+componentType.DISPLAY_NAME); + } return materialName+" Cell"; } @@ -132,8 +133,9 @@ public class BaseItemComponent extends Item{ //list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring."); } if (componentMaterial != null){ - if (!componentMaterial.vChemicalFormula.equals("??")) + if (!componentMaterial.vChemicalFormula.equals("??")) { list.add(componentMaterial.vChemicalFormula); + } if (componentMaterial.isRadioactive){ list.add(CORE.GT_Tooltip_Radioactive); diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java index 6c3fb531dd..9c7b14f648 100644 --- a/src/Java/gtPlusPlus/core/item/base/CoreItem.java +++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java @@ -177,7 +177,7 @@ public class CoreItem extends Item @Override public String getItemStackDisplayName(ItemStack tItem) { - if (itemName == null || itemName.equals("") || itemName == "") + if (itemName == null || itemName.equals("")) return super.getItemStackDisplayName(tItem); return itemName; } diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java index 2c3ee38048..b9345f6f57 100644 --- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java @@ -38,7 +38,7 @@ public class BaseItemCell extends BaseItemComponent{ private int fluidBright = 0; private int tickValue; - private short fluidColour[]; + private short[] fluidColour; boolean upwards = true; @Override diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index 4e4192262a..696f497afc 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -65,7 +65,7 @@ public class BaseItemDust extends Item{ temp = temp.replace("itemD", "d"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); } - if (temp != null && temp != ""){ + if (temp != null && !temp.equals("")){ oredictName = temp; GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } @@ -175,7 +175,7 @@ public class BaseItemDust extends Item{ tempIngot = tempIngot.replace("itemDust", "ingot"); Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot); ItemStack[] outputStacks = {dustInfo.getDust(1)}; - if (tempIngot != null && tempIngot != ""){ + if (tempIngot != null && !tempIngot.equals("")){ tempInputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempIngot, 1); tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(tempDust, 1); ItemStack tempStackOutput2 = null; @@ -216,7 +216,7 @@ public class BaseItemDust extends Item{ return; } temp = temp.replace("itemDust", "ingot"); - if (temp != null && temp != ""){ + if (temp != null && !temp.equals("")){ if (dustInfo.requiresBlastFurnace()){ Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace."); @@ -230,7 +230,7 @@ public class BaseItemDust extends Item{ } Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a furnace."); ItemStack tempOutputStack = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); - Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); + //Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp); if (null != tempOutputStack){ if (mTier < 5 || !dustInfo.requiresBlastFurnace()){ if (CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(ItemUtils.getSimpleStack(this), tempOutputStack)){ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index a2b5bff7f4..3f6ff6e358 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -35,7 +35,7 @@ public class BaseItemIngot extends BaseItemComponent{ } temp = temp.replace("itemIngot", "block"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); - if (temp != null && temp != ""){ + if (temp != null && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput); diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOLD.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOLD.java index 20e72f2a64..15b1e48200 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOLD.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotOLD.java @@ -39,7 +39,7 @@ public class BaseItemIngotOLD extends Item{ else if (unlocalName.contains("itemHotIngot")){ temp = unlocalName.replace("itemHotIngot", "ingotHot"); } - if (temp != null && temp != ""){ + if (temp != null && !temp.equals("")){ GT_OreDictUnificator.registerOre(temp, ItemUtils.getSimpleStack(this)); } generateCompressorRecipe(); @@ -76,7 +76,7 @@ public class BaseItemIngotOLD extends Item{ } temp = temp.replace("itemIngot", "block"); Utils.LOG_WARNING("Generating OreDict Name: "+temp); - if (temp != null && temp != ""){ + if (temp != null && !temp.equals("")){ tempOutput = ItemUtils.getItemStackOfAmountFromOreDict(temp, 1); if (tempOutput != null){ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput); diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 468940ac59..82c38de8bd 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -153,6 +153,9 @@ public class ItemUtils { @SuppressWarnings("unused") public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){ try { + if (item == null){ + return null; + } Item em = item; Item em1 = item; Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta); @@ -192,7 +195,7 @@ public class ItemUtils { public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) { if (item_Input instanceof String){ - return getCorrectStacktype(item_Input, stackSize); + return getItemStackOfAmountFromOreDictNoBroken((String) item_Input, stackSize); } else if (item_Input instanceof ItemStack){ return (ItemStack) item_Input; @@ -234,7 +237,7 @@ public class ItemUtils { public static ItemStack[] validItemsForOreDict(String oredictName){ List<?> validNames = MaterialUtils.oreDictValuesForEntry(oredictName); - ItemStack[] inputs = null; + ItemStack[] inputs = new ItemStack[validNames.size()]; for (int i=0; i<validNames.size();i++){ inputs[i] = (ItemStack) validNames.get(i); } diff --git a/src/Java/gtPlusPlus/core/util/player/PlayerCache.java b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java index 969de8dc08..85bba2470a 100644 --- a/src/Java/gtPlusPlus/core/util/player/PlayerCache.java +++ b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java @@ -14,7 +14,7 @@ public class PlayerCache { private static final File cache = new File("PlayerCache.dat"); public static final void initCache() { - if (CORE.PlayerCache == null || CORE.PlayerCache.equals(null)){ + if (CORE.PlayerCache == null){ try { if (cache != null){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java index 8f0fc9cb35..617335eac6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java @@ -190,7 +190,7 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered return true; } - if (!aPlayer.equals(null)) { + if (aPlayer != null) { UUID tempUUID = aPlayer.getUniqueID(); /*if (!aPlayer.worldObj.isRemote){ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString()); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java index bb2c8780d1..b3a1fb456c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java @@ -74,11 +74,11 @@ public class GregtechMetaTileEntityDoubleFuelGeneratorBase return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced); } - else if (this.mTier >= 6){ + else { return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); } - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); + //return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 1afa3634e2..ee36a920b0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -74,11 +74,11 @@ public class GregtechMetaTileEntityRocketFuelGenerator return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced); } - else if (this.mTier >= 6){ + else{ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); } - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); + //return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java index 5fad590f3f..89c6c033d7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java @@ -336,8 +336,15 @@ public class GregtechMTE_NuclearReactor extends GT_MetaTileEntity_MultiBlockBase this.mLastRecipe = null; return false; } + + if (tRecipe == null){ + return false; + } + if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { - this.mLastRecipe = tRecipe; + if (tRecipe != null){ + this.mLastRecipe = tRecipe; + } this.mEUt = (this.mLastRecipe.mEUt * overclock(this.mLastRecipe.mSpecialValue)); this.mMaxProgresstime = this.mLastRecipe.mDuration / overclock(this.mLastRecipe.mSpecialValue); this.mEfficiencyIncrease = 10000; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java index e6abbbd063..5e552f6647 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityAnimalFarm.java @@ -17,7 +17,6 @@ import gtPlusPlus.xmod.forestry.trees.TreefarmManager; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import java.lang.reflect.Field; -import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -32,7 +31,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)}; - public ArrayList<GT_MetaTileEntity_TieredMachineBlock> mCasings = new ArrayList(); + //public ArrayList<GT_MetaTileEntity_TieredMachineBlock> mCasings = new ArrayList(); private boolean running = false; private boolean p1, p2, p3, p4, p5, p6; @@ -148,7 +147,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - this.mCasings.clear(); + //this.mCasings.clear(); Utils.LOG_INFO("Step 1"); int xDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; int zDir = net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; @@ -266,7 +265,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo } } mSolderingTool = true; - turnCasingActive(true); + //turnCasingActive(true); Utils.LOG_INFO("Multiblock Formed."); return true; } @@ -303,24 +302,14 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo if (aMetaTileEntity == null) return false; if (aMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock) { - return this.mCasings.add((GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity); + //return this.mCasings.add((GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity); } return false; } - public boolean turnCasingActive(boolean status) { - if (this.mCasings != null) { - Utils.LOG_INFO("Changing casing Textures."); - for (GT_MetaTileEntity_TieredMachineBlock hatch : this.mCasings) { - hatch = changeTextureswithReflection(hatch, getTextureSet()); - } - } - return true; - } - private GT_MetaTileEntity_TieredMachineBlock changeTextureswithReflection(GT_MetaTileEntity_TieredMachineBlock casing, ITexture[][][] textureSet){ GT_MetaTileEntity_TieredMachineBlock cv = casing; - System.out.println("Before: "+cv.mTextures.hashCode()); + //System.out.println("Before: "+cv.mTextures.hashCode()); //Get declared field from class Field f; try { @@ -336,7 +325,7 @@ public class GregtechMetaTileEntityAnimalFarm extends GT_MetaTileEntity_MultiBlo //change the field value f.set(cv, textureSet); //Verify change in texture set - System.out.println("After: "+cv.mTextures.hashCode()); + //System.out.println("After: "+cv.mTextures.hashCode()); return cv; } catch (NoSuchFieldException e) { Utils.LOG_INFO("Could not find mTextures."); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java index 50ff576724..fec81aaa15 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java @@ -549,24 +549,24 @@ extends GregtechMeta_MultiBlockBase { return tempTankStorageMax; } - private void tryForceNBTUpdate(){ + private boolean tryForceNBTUpdate(){ //Block is invalid. if (this == null || this.getBaseMetaTileEntity() == null){ Utils.LOG_WARNING("Block was not valid for saving data."); - return; + return false; } //Don't need this to run clientside. if (!this.getBaseMetaTileEntity().isServerSide()) { - return; + return false; } //Internal Tag was not valid. try{ if (internalCraftingComponentsTag == null){ Utils.LOG_WARNING("Internal NBT data tag was null."); - return; + return false; } } catch (NullPointerException x){ Utils.LOG_WARNING("Caught null NBT."); @@ -584,6 +584,7 @@ extends GregtechMeta_MultiBlockBase { this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z); //Mark block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly) - this.getBaseMetaTileEntity().markDirty(); + this.getBaseMetaTileEntity().markDirty(); + return true; } } |