aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/nei
diff options
context:
space:
mode:
authorJohannes Gäßler <updrn@student.kit.edu>2017-04-10 20:57:44 +0200
committerJohannes Gäßler <updrn@student.kit.edu>2017-04-10 20:57:44 +0200
commit822cf1ec3e5b753e4f1f98dc1d408a3d76fa29ce (patch)
treee748f640eae810fe44834219252fda4aee903ce5 /src/main/java/gregtech/nei
parentee5af6ac407bd576afd002425ae59ab65b7b9a63 (diff)
downloadGT5-Unofficial-822cf1ec3e5b753e4f1f98dc1d408a3d76fa29ce.tar.gz
GT5-Unofficial-822cf1ec3e5b753e4f1f98dc1d408a3d76fa29ce.tar.bz2
GT5-Unofficial-822cf1ec3e5b753e4f1f98dc1d408a3d76fa29ce.zip
Expanded the NEI api to allow for custom descriptions, added liquid
fuels to the newly created Large Boiler tab Instead of the default information like total EU or EU usage it is now possible to provide custom Strings to describe a recipe. The Large Boiler NEI tab explicitly shows burn times for fuels depending on the boiler used. Any liquid fuel added to Diesel Fuels or Semifluid Fuels will automatically be added to Large Boiler Fuels.
Diffstat (limited to 'src/main/java/gregtech/nei')
-rw-r--r--src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java61
1 files changed, 35 insertions, 26 deletions
diff --git a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
index 71e458c634..030a9ad06a 100644
--- a/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
+++ b/src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
@@ -198,32 +198,41 @@ public class GT_NEI_DefaultHandler
return currenttip;
}
- 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);
- }
- }
- if (tDuration > 0) {
- drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
- }
- int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
- if(tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing){
- drawText(10, 123, "Needs Low Gravity", -16777216);
- }else if(tSpecial == -200){
- drawText(10, 123, "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);
- }
- }
+ public void drawExtras(int aRecipeIndex) {
+ int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
+ int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ String[] recipeDesc = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc();
+ if (recipeDesc == null) {
+ 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);
+ }
+ }
+ if (tDuration > 0) {
+ drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
+ }
+ int tSpecial = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
+ if (tSpecial == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) {
+ drawText(10, 123, "Needs Low Gravity", -16777216);
+ } else if (tSpecial == -200) {
+ drawText(10, 123, "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++;
+ }
+ }
+ }
public static class GT_RectHandler
implements IContainerInputHandler, IContainerTooltipHandler {