aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java
diff options
context:
space:
mode:
authorDaniel <daniel112092@gmail.com>2017-06-18 11:30:32 +0200
committerGitHub <noreply@github.com>2017-06-18 11:30:32 +0200
commit80a56026b16d49a18fd3d42a2d3dfa06de167c82 (patch)
tree8112db284de8e9240865e05577bd19c14ecc71f1 /src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java
parentd7f24f3e68826adb1a15369628ded0744c123fca (diff)
parent6f7e5063c0552c01dcc412ca01f0a243776dd9a1 (diff)
downloadGT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.tar.gz
GT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.tar.bz2
GT5-Unofficial-80a56026b16d49a18fd3d42a2d3dfa06de167c82.zip
Merge pull request #26 from GTNewHorizons/reMerge
Re merge
Diffstat (limited to 'src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java')
-rw-r--r--src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java47
1 files changed, 32 insertions, 15 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java
index c917bb9e71..a2fad03c6f 100644
--- a/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java
+++ b/src/main/java/gregtech/nei/GT_NEI_AssLineHandler.java
@@ -10,6 +10,7 @@ import codechicken.nei.recipe.GuiRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import cpw.mods.fml.common.event.FMLInterModComms;
+import gregtech.GT_Mod;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.gui.GT_GUIContainer_BasicMachine;
@@ -31,6 +32,8 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import static gregtech.api.util.GT_Utility.trans;
+
public class GT_NEI_AssLineHandler
extends TemplateRecipeHandler {
public static final int sOffsetX = 5;
@@ -212,22 +215,36 @@ public class GT_NEI_AssLineHandler
public void drawExtras(int aRecipeIndex) {
int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- if (tEUt != 0) {
- drawText(10, 73, "Total: " + tDuration * tEUt + " EU", -16777216);
- drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216);
- if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(10, 93, "Voltage: " + tEUt / this.mRecipeMap.mAmperage + " EU", -16777216);
- drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216);
- } else {
- drawText(10, 93, "Voltage: unspecified", -16777216);
- drawText(10, 103, "Amperage: unspecified", -16777216);
+ String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc();
+ if (recipeDesc == null) {
+ if (tEUt != 0) {
+ drawText(10, 73, trans("152","Total: ") + 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", -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);
+ }
+ }
+ if (tDuration > 0) {
+ drawText(10, 113, trans("158","Time: ")+String.format("%.2f " + trans("161"," secs"), 0.05F * tDuration), -16777216);
+ }
+ int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
+ if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) {
+ drawText(10, 123, trans("159","Needs Low Gravity"), -16777216);
+ } else if (tSpecial == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) {
+ drawText(10, 123, trans("160","Needs Cleanroom"), -16777216);
+ } else if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
+ drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + tSpecial * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216);
+ }
+ } else {
+ int i = 0;
+ for (String descLine : recipeDesc) {
+ drawText(10, 73 + 10 * i, descLine, -16777216);
+ i++;
}
- }
- if (tDuration > 0) {
- drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
- }
- if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
- drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier + this.mRecipeMap.mNEISpecialValuePost, -16777216);
}
}