From 5eb28573897020b2e60415a61e408473772c3c75 Mon Sep 17 00:00:00 2001 From: Muramasa Date: Sun, 14 Aug 2016 07:40:20 +0100 Subject: [PATCH] Bugfixes 3/2/1 fix: Remove commented code --- .../api/gui/GT_GUIContainerMetaTile_Machine.java | 3 +-- .../GT_MetaTileEntity_Hatch_Maintenance.java | 5 +---- .../GT_MetaTileEntity_MultiBlockBase.java | 5 +---- .../java/gregtech/api/objects/ElementStack.java | 1 - .../java/gregtech/api/objects/MaterialStack.java | 1 - .../GT_MetaTileEntity_BronzeBlastFurnace.java | 5 +---- .../multi/GT_MetaTileEntity_LargeBoiler.java | 5 +---- .../GT_MetaTileEntity_LargeTurbine_HPSteam.java | 5 +---- .../GT_MetaTileEntity_LargeTurbine_Steam.java | 5 +---- .../multi/GT_MetaTileEntity_ProcessingArray.java | 15 ++++++--------- 10 files changed, 13 insertions(+), 37 deletions(-) diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index 574b1110..b9cae3e0 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -29,8 +29,7 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { super.drawGuiContainerBackgroundLayer(par1, par2, par3); if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) { int tColor = mContainer.mTileEntity.getColorization() & 15; - /* Bug kind and pattern: INT - INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE */ - if (/*tColor >= 0 && */tColor < ItemDye.field_150922_c.length) { + if (tColor < ItemDye.field_150922_c.length) { tColor = ItemDye.field_150922_c[tColor]; GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F); } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java index e7acfb85..552d98f5 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java @@ -112,10 +112,7 @@ public class GT_MetaTileEntity_Hatch_Maintenance extends GT_MetaTileEntity_Hatch } if (mSolderingTool && aPlayer instanceof EntityPlayerMP) { EntityPlayerMP tPlayer = (EntityPlayerMP) aPlayer; - //try { - GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchievement(tPlayer, "maintainance"); } } diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 823790b9..276f8aa0 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -238,10 +238,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) { if (mOutputItems != null) for (ItemStack tStack : mOutputItems) if (tStack != null) { - //try { - GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchivementHatch(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), tStack); addOutput(tStack); } if (mOutputFluids != null && mOutputFluids.length == 1) { diff --git a/src/main/java/gregtech/api/objects/ElementStack.java b/src/main/java/gregtech/api/objects/ElementStack.java index 207d77f7..e406461d 100644 --- a/src/main/java/gregtech/api/objects/ElementStack.java +++ b/src/main/java/gregtech/api/objects/ElementStack.java @@ -18,7 +18,6 @@ public class ElementStack implements Cloneable { @Override public ElementStack clone() { try { Object cloneES = super.clone(); - //return new ElementStack(mElement, mAmount); return (ElementStack) cloneES; } catch (Exception e) { return new ElementStack(mElement, mAmount); } } diff --git a/src/main/java/gregtech/api/objects/MaterialStack.java b/src/main/java/gregtech/api/objects/MaterialStack.java index 60808ab6..bba0753d 100644 --- a/src/main/java/gregtech/api/objects/MaterialStack.java +++ b/src/main/java/gregtech/api/objects/MaterialStack.java @@ -18,7 +18,6 @@ public class MaterialStack implements Cloneable { @Override public MaterialStack clone() { try { Object cloneMS = super.clone(); - //return new MaterialStack(mMaterial, mAmount); return (MaterialStack) cloneMS;} catch (Exception e) { return new MaterialStack(mMaterial, mAmount); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index 2ab130bc..6877c415 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -201,10 +201,7 @@ public class GT_MetaTileEntity_BronzeBlastFurnace this.mOutputItem2 = null; this.mProgresstime = 0; this.mMaxProgresstime = 0; - //try { - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); } } else if (aBaseMetaTileEntity.isAllowedToWork()) { checkRecipe(); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java index 02a6d615..40a72f81 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java @@ -151,10 +151,7 @@ public abstract class GT_MetaTileEntity_LargeBoiler public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (mProgresstime > 0 && firstRun) { firstRun = false; - //try { - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure"); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "extremepressure"); } super.onPostTick(aBaseMetaTileEntity, aTick); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index d05c5118..b9c12514 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -86,10 +86,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La remainingFlow -= flow; // track amount we're allowed to keep depleting from hatches totalFlow += flow; // track total used if (!achievement) { - //try { - GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); achievement = true; } }else if(fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")){ diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index 21c66c82..7fba8ac2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -95,10 +95,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches totalFlow += flow; // track total input used if (!achievement) { - //try { - GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); - //} catch (Exception e) { - //} + GT_Mod.instance.achievements.issueAchievement(this.getBaseMetaTileEntity().getWorld().getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); achievement = true; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index bb3ef55b..04fab35f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -238,15 +238,12 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); List overStacks = new ArrayList(); for (int f = 0; f < tOut.length; f++) { - /* FindBugs: Bug kind and pattern: RpC - RpC_REPEATED_CONDITIONAL_TEST */ - //if (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { - ItemStack tmp = tOut[f].copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); - overStacks.add(tmp); - } - //} + while (tOut[f].getMaxStackSize() < tOut[f].stackSize) { + ItemStack tmp = tOut[f].copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize(); + overStacks.add(tmp); + } } if (overStacks.size() > 0) { ItemStack[] tmp = new ItemStack[overStacks.size()];