aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java56
-rw-r--r--src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java9
2 files changed, 39 insertions, 26 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 5a5ba21fa4..17f54b6f53 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -814,7 +814,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (aInputs == null) return null;
int tAmount = 0;
for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
- if (tAmount < mMinimalInputItems) return null;
+ if (tAmount < mMinimalInputItems) return null;
}
}
@@ -1592,9 +1592,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
if (aInputs == null) {
aInputs = new ItemStack[0];
+ } else {
+ aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
}
+
for (ItemStack input : aInputs) {
- FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input);
+ FluidStack inputFluidContent = FluidContainerRegistry.getFluidForFilledItem(input);
if (inputFluidContent != null) {
inputFluidContent.amount *= input.stackSize;
if (inputFluidContent.getFluid().getName().equals("ic2steam")) {
@@ -1628,8 +1631,11 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
aInputs = adjustedInputs.toArray(new ItemStack[adjustedInputs.size()]);
aFluidInputs = adjustedFluidInputs.toArray(new FluidStack[adjustedFluidInputs.size()]);
+
if (aOutputs == null) {
aOutputs = new ItemStack[0];
+ } else {
+ aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
}
for (ItemStack output : aOutputs) {
@@ -1677,34 +1683,36 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
ArrayList<PositionedStack> inputStacks = new ArrayList<PositionedStack>(inputlimit);
for (int i = 0; i < itemLimit; i++, j++) {
- if (GT_Values.allow_broken_recipemap) {
- if (this != null && this.mInputs != null && this.mInputs[i] != null)
- inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- else {
- if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
- GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
- else
- GT_Log.out.println("recipe " + this.toString() + " has errored!");
- inputStacks.add(new FixedPositionedStack(new ItemStack(Items.command_block_minecart), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- }
- }else
+ if( this.mInputs == null || (this.mInputs[i] == null && (i == 0 && itemLimit == 1)) ) {
+ if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+
+ new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
+ }
+
+
+ if ((this.mInputs != null && this.mInputs[i] != null) || !GT_Values.allow_broken_recipemap)
inputStacks.add(new FixedPositionedStack(this.mInputs[i].copy(), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
+ else
+ inputStacks.add(new FixedPositionedStack(new ItemStack(Items.command_block_minecart), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
}
for (int i = 0; i < fluidLimit; i++, j++) {
- if (GT_Values.allow_broken_recipemap) {
- if (this != null && this.mFluidInputs != null && this.mFluidInputs[i] != null)
- inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
- else {
- if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
- GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
- else
- GT_Log.out.println("recipe " + this.toString() + " has errored!");
- }
- }else
+ if (this.mFluidInputs == null || this.mFluidInputs[i] == null) {
+ if (this.mOutputs != null && this.mOutputs.length > 0 && this.mOutputs[0] != null)
+ GT_Log.out.println("recipe " + this.toString() + " Output 0:" + this.mOutputs[0].getDisplayName() + " has errored!");
+ else
+ GT_Log.out.println("recipe " + this.toString() + " has errored!");
+
+ new Exception("Recipe Fixme").printStackTrace(GT_Log.out);
+ }
+
+ if ((this.mFluidInputs != null && this.mFluidInputs[i] != null) || !GT_Values.allow_broken_recipemap)
inputStacks.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(this.mFluidInputs[i], true), 48 - j % 3 * 18, (j >= 3 ? 5 : 23)));
}
-
+
return inputStacks;
}
diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
index 305e491198..8a659ec10b 100644
--- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
+++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
@@ -209,8 +209,13 @@ public class GT_NEI_DefaultHandler
drawText(10, 73, trans("152","Total: ") + ((long)tDuration * tEUt) + " EU", -16777216);
drawText(10, 83, trans("153","Usage: ") + tEUt + " EU/t", -16777216);
if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU ("+GT_Values.VN[GT_Utility.getTier(tEUt / this.mRecipeMap.mAmperage)]+")", -16777216);
- drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216);
+ byte tier=GT_Utility.getTier(tEUt / this.mRecipeMap.mAmperage);
+ if(tier<0||tier>=16){
+ drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU", 0xffFF0000);
+//add here gt logger
+ }else{
+ drawText(10, 93, trans("154","Voltage: ") + tEUt / this.mRecipeMap.mAmperage + " EU ("+GT_Values.VN[tier]+")", -16777216);
+ }drawText(10, 103, trans("155","Amperage: ") + this.mRecipeMap.mAmperage, -16777216);
} else {
drawText(10, 93, trans("156","Voltage: unspecified"), -16777216);
drawText(10, 103, trans("157","Amperage: unspecified"), -16777216);