aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuramasa <haydenkilloh@gmail.com>2016-08-13 03:04:47 +0100
committerMuramasa <haydenkilloh@gmail.com>2016-08-13 07:09:55 +0100
commit349510f2dabc9e7dc9ae5ff1fdc71fef11dd8016 (patch)
tree9dbe7a2a61982b88123ee377cb2950c33b6981f1
parente6ecf4f2989eed1caedab4e0b01a13ddfd1be0b2 (diff)
downloadGT5-Unofficial-349510f2dabc9e7dc9ae5ff1fdc71fef11dd8016.tar.gz
GT5-Unofficial-349510f2dabc9e7dc9ae5ff1fdc71fef11dd8016.tar.bz2
GT5-Unofficial-349510f2dabc9e7dc9ae5ff1fdc71fef11dd8016.zip
Bugfixes 1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java3
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java42
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java12
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java2
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java5
5 files changed, 33 insertions, 31 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 4c20715e68..574b111039 100644
--- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
+++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java
@@ -29,7 +29,8 @@ 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;
- if (tColor >= 0 && tColor < ItemDye.field_150922_c.length) {
+ /* Bug kind and pattern: INT - INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE */
+ if (/*tColor >= 0 && */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/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index be85ca29ce..25992d2739 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -1267,33 +1267,31 @@ public class GT_ModHandler {
for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
ItemStack tStack = tRecipe.getRecipeOutput();
if (GT_Utility.isStackValid(tStack) && tStack.getMaxStackSize() == 1 && tStack.getMaxDamage() > 0 && !(tStack.getItem() instanceof ItemBlock) && !(tStack.getItem() instanceof IReactorComponent) && !isElectricItem(tStack) && !GT_Utility.isStackInList(tStack, sNonReplaceableItems)) {
- if (!(tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) {
- if (tRecipe instanceof ShapedOreRecipe) {
- boolean temp = true;
- for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
- if (tObject != null) {
- if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
- temp = false;
- break;
- }
- if (tObject instanceof List && ((List) tObject).isEmpty()) {
- temp = false;
- break;
- }
+ if (tRecipe instanceof ShapedOreRecipe) {
+ boolean temp = true;
+ for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
+ if (tObject != null) {
+ if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
+ temp = false;
+ break;
}
- if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
- } else if (tRecipe instanceof ShapedRecipes) {
- boolean temp = true;
- for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
- if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
+ if (tObject instanceof List && ((List) tObject).isEmpty()) {
temp = false;
break;
}
}
- if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
- } else {
- sSingleNonBlockDamagableRecipeList.add(tRecipe);
+ if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
+ } else if (tRecipe instanceof ShapedRecipes) {
+ boolean temp = true;
+ for (ItemStack tObject : ((ShapedRecipes) tRecipe).recipeItems) {
+ if (tObject != null && (tObject.getItem() == null || tObject.getMaxStackSize() < 2 || tObject.getMaxDamage() > 0 || tObject.getItem() instanceof ItemBlock)) {
+ temp = false;
+ break;
+ }
}
+ if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
+ } else {
+ sSingleNonBlockDamagableRecipeList.add(tRecipe);
}
}
}
@@ -1403,7 +1401,7 @@ public class GT_ModHandler {
for (Entry<IRecipeInput, RecipeOutput> tEntry : aRecipeList.entrySet()) {
if (tEntry.getKey().matches(aInput)) {
if (tEntry.getKey().getAmount() <= aInput.stackSize) {
- ItemStack[] tList = (ItemStack[]) tEntry.getValue().items.toArray();
+ ItemStack[] tList = (ItemStack[]) tEntry.getValue().items.toArray(new ItemStack[tEntry.getValue().items.size()]);
if (tList.length == 0) break;
ItemStack[] rList = new ItemStack[aOutputSlots.length];
rRecipeMetaData.setTag("return", tEntry.getValue().metadata);
diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java
index f9cf4f9750..ffe2a39a0a 100644
--- a/src/main/java/gregtech/common/GT_Proxy.java
+++ b/src/main/java/gregtech/common/GT_Proxy.java
@@ -175,12 +175,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
}
- for (String tOreName : OreDictionary.getOreNames()) {
- ItemStack tOreStack;
- for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
- tOreStack = (ItemStack) i$.next();
+ try {
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ tOreStack = (ItemStack) i$.next();
+ }
}
- }
+ } catch (Throwable e) {e.printStackTrace(GT_Log.err);}
}
private static final void registerRecipes(OreDictEventContainer aOre) {
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
index 7d950a490b..72dd43d089 100644
--- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
+++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java
@@ -265,7 +265,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
if (tFluidList.size() > 1) {
FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[8], tFluids, new ItemStack[]{});
- if (tRecipe == null && !mRunningOnLoad) {
+ if (mRunningOnLoad) {
turnCasingActive(false);
this.mLastRecipe = null;
return false;
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 7183aa30c1..bb3ef55b9f 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,14 +238,15 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
List<ItemStack> overStacks = new ArrayList<ItemStack>();
for (int f = 0; f < tOut.length; f++) {
- if (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
+ /* 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);
}
- }
+ //}
}
if (overStacks.size() > 0) {
ItemStack[] tmp = new ItemStack[overStacks.size()];