Bugfixes 1
This commit is contained in:
parent
e6ecf4f298
commit
349510f2da
5 changed files with 33 additions and 31 deletions
|
@ -29,7 +29,8 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer {
|
||||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||||
if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) {
|
if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) {
|
||||||
int tColor = mContainer.mTileEntity.getColorization() & 15;
|
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];
|
tColor = ItemDye.field_150922_c[tColor];
|
||||||
GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F);
|
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);
|
} else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
|
@ -1267,33 +1267,31 @@ public class GT_ModHandler {
|
||||||
for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
|
for (IRecipe tRecipe : (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
|
||||||
ItemStack tStack = tRecipe.getRecipeOutput();
|
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 (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) {
|
||||||
if (tRecipe instanceof ShapedOreRecipe) {
|
boolean temp = true;
|
||||||
boolean temp = true;
|
for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
|
||||||
for (Object tObject : ((ShapedOreRecipe) tRecipe).getInput())
|
if (tObject != null) {
|
||||||
if (tObject != null) {
|
if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
|
||||||
if (tObject instanceof ItemStack && (((ItemStack) tObject).getItem() == null || ((ItemStack) tObject).getMaxStackSize() < 2 || ((ItemStack) tObject).getMaxDamage() > 0 || ((ItemStack) tObject).getItem() instanceof ItemBlock)) {
|
temp = false;
|
||||||
temp = false;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (tObject instanceof List && ((List) tObject).isEmpty()) {
|
|
||||||
temp = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
|
if (tObject instanceof List && ((List) tObject).isEmpty()) {
|
||||||
} 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;
|
temp = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
|
if (temp) sSingleNonBlockDamagableRecipeList.add(tRecipe);
|
||||||
} else {
|
} else if (tRecipe instanceof ShapedRecipes) {
|
||||||
sSingleNonBlockDamagableRecipeList.add(tRecipe);
|
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()) {
|
for (Entry<IRecipeInput, RecipeOutput> tEntry : aRecipeList.entrySet()) {
|
||||||
if (tEntry.getKey().matches(aInput)) {
|
if (tEntry.getKey().matches(aInput)) {
|
||||||
if (tEntry.getKey().getAmount() <= aInput.stackSize) {
|
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;
|
if (tList.length == 0) break;
|
||||||
ItemStack[] rList = new ItemStack[aOutputSlots.length];
|
ItemStack[] rList = new ItemStack[aOutputSlots.length];
|
||||||
rRecipeMetaData.setTag("return", tEntry.getValue().metadata);
|
rRecipeMetaData.setTag("return", tEntry.getValue().metadata);
|
||||||
|
|
|
@ -175,12 +175,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {
|
||||||
for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||||
onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
|
onFluidContainerRegistration(new FluidContainerRegistry.FluidContainerRegisterEvent(tData));
|
||||||
}
|
}
|
||||||
for (String tOreName : OreDictionary.getOreNames()) {
|
try {
|
||||||
ItemStack tOreStack;
|
for (String tOreName : OreDictionary.getOreNames()) {
|
||||||
for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
|
ItemStack tOreStack;
|
||||||
tOreStack = (ItemStack) i$.next();
|
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) {
|
private static final void registerRecipes(OreDictEventContainer aOre) {
|
||||||
|
|
|
@ -265,7 +265,7 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity
|
||||||
if (tFluidList.size() > 1) {
|
if (tFluidList.size() > 1) {
|
||||||
FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]);
|
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[]{});
|
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);
|
turnCasingActive(false);
|
||||||
this.mLastRecipe = null;
|
this.mLastRecipe = null;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -238,14 +238,15 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl
|
||||||
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
|
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
|
||||||
List<ItemStack> overStacks = new ArrayList<ItemStack>();
|
List<ItemStack> overStacks = new ArrayList<ItemStack>();
|
||||||
for (int f = 0; f < tOut.length; f++) {
|
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) {
|
while (tOut[f].getMaxStackSize() < tOut[f].stackSize) {
|
||||||
ItemStack tmp = tOut[f].copy();
|
ItemStack tmp = tOut[f].copy();
|
||||||
tmp.stackSize = tmp.getMaxStackSize();
|
tmp.stackSize = tmp.getMaxStackSize();
|
||||||
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
|
tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
|
||||||
overStacks.add(tmp);
|
overStacks.add(tmp);
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
if (overStacks.size() > 0) {
|
if (overStacks.size() > 0) {
|
||||||
ItemStack[] tmp = new ItemStack[overStacks.size()];
|
ItemStack[] tmp = new ItemStack[overStacks.size()];
|
||||||
|
|
Loading…
Reference in a new issue