aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dependencies.gradle2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java2
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java93
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java23
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java49
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java33
7 files changed, 32 insertions, 173 deletions
diff --git a/dependencies.gradle b/dependencies.gradle
index bf9bf42c0a..59ce54381d 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -1,7 +1,7 @@
// Add your dependencies here
dependencies {
- compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.148:dev")
+ compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.195:dev")
compile("com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev")
compile("com.github.GTNewHorizons:TecTech:5.0.52:dev")
compile("com.github.GTNewHorizons:NotEnoughItems:2.3.14-GTNH:dev")
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
index ace13e1801..aa63d8958d 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_HTGR.java
@@ -251,7 +251,7 @@ public class GT_TileEntity_HTGR extends GT_MetaTileEntity_EnhancedMultiBlockBase
1,
"",
false,
- false)
+ true)
.useModularUI(true);
private static final int HELIUM_NEEDED = 730000;
private static final int powerUsage = BW_Util.getMachineVoltageFromTier(6);
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
index 2a2e2102ca..fbf30a9350 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_BioVatHandler.java
@@ -27,24 +27,18 @@ import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler;
import com.github.bartimaeusnek.bartworks.common.items.LabParts;
-import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat;
import cpw.mods.fml.common.event.FMLInterModComms;
-import gregtech.GT_Mod;
import gregtech.api.enums.GT_Values;
import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Utility;
import gregtech.nei.GT_NEI_DefaultHandler;
import java.awt.*;
import java.util.Collections;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
public BW_NEI_BioVatHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
super(aRecipeMap);
- this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
- new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier()));
if (!NEI_BW_Config.sIsAdded) {
FMLInterModComms.sendRuntimeMessage(
GT_Values.GT,
@@ -56,96 +50,11 @@ public class BW_NEI_BioVatHandler extends GT_NEI_DefaultHandler {
}
}
+ @Override
public TemplateRecipeHandler newInstance() {
return new BW_NEI_BioVatHandler(this.mRecipeMap);
}
- public void drawExtras(int aRecipeIndex) {
- int base = getDescriptionYOffset() - 2;
- int[] lines = {base, base + 8, base + 16, base + 24, base + 32, base + 40, base + 48, base + 56, base + 64};
- int tEUt = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
- int tDuration = ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
- String[] recipeDesc =
- ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.getNeiDesc();
- int tSpecial;
- if (recipeDesc == null) {
- if (tEUt != 0) {
- drawText(
- 10,
- lines[0],
- this.trans("152", "Total: ") + GT_Utility.formatNumbers((long) tDuration * (long) tEUt) + " EU",
- -16777216);
- drawText(
- 10,
- lines[1],
- this.trans("153", "Usage: ") + GT_Utility.formatNumbers(tEUt) + " EU/t",
- -16777216);
- if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
- drawText(
- 10,
- lines[2],
- this.trans("154", "Voltage: ") + GT_Utility.formatNumbers(tEUt / this.mRecipeMap.mAmperage)
- + " EU",
- -16777216);
- drawText(
- 10,
- lines[3],
- this.trans("155", "Amperage: ") + GT_Utility.formatNumbers(this.mRecipeMap.mAmperage),
- -16777216);
- } else {
- drawText(10, lines[2], this.trans("156", "Voltage: unspecified"), -16777216);
- drawText(10, lines[3], this.trans("157", "Amperage: unspecified"), -16777216);
- }
- }
-
- if (tDuration > 0) {
- drawText(
- 10,
- lines[4],
- this.trans("158", "Time: ")
- + GT_Utility.formatNumbers(0.05d * tDuration)
- + this.trans("161", " secs"),
- -16777216);
- }
-
- tSpecial =
- ((GT_NEI_DefaultHandler.CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue;
-
- int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(tSpecial);
-
- drawText(10, lines[5], StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0], -16777216);
-
- if (tSpecialA[1] == -100 && GT_Mod.gregtechproxy.mLowGravProcessing) {
- drawText(10, lines[7], this.trans("159", "Needs Low Gravity"), -16777216);
- } else if (tSpecialA[1] == -200 && GT_Mod.gregtechproxy.mEnableCleanroom) {
- drawText(10, lines[7], this.trans("160", "Needs Cleanroom"), -16777216);
- } else if (tSpecialA[1] == -300 && GT_Mod.gregtechproxy.mEnableCleanroom) {
- drawText(10, lines[7], this.trans("160.1", "Needs Cleanroom & LowGrav"), -16777216);
- } else if (tSpecialA[1] == -400) {
- drawText(10, lines[7], this.trans("216", "Deprecated Recipe"), -16777216);
- } else if (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)
- || GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost)) {
- drawText(
- 10,
- lines[6],
- (tSpecialA[2] == 1
- ? StatCollector.translateToLocal("nei.biovat.1.name")
- : StatCollector.translateToLocal("nei.biovat.2.name"))
- + this.mRecipeMap.mNEISpecialValuePre
- + GT_Utility.formatNumbers(tSpecialA[3] * this.mRecipeMap.mNEISpecialValueMultiplier)
- + this.mRecipeMap.mNEISpecialValuePost,
- -16777216);
- }
- } else {
- tSpecial = 0;
-
- for (String descLine : recipeDesc) {
- drawText(10, 73 + 10 * tSpecial, descLine, -16777216);
- ++tSpecial;
- }
- }
- }
-
private void loadLabPartRecipes(ItemStack aResult) {
for (CachedDefaultRecipe recipe : getCache()) {
// dirty way of finding the special slot item
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java
deleted file mode 100644
index 56ad735bcd..0000000000
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_HTGRHandler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.github.bartimaeusnek.bartworks.neiHandler;
-
-import codechicken.nei.recipe.GuiCraftingRecipe;
-import codechicken.nei.recipe.GuiUsageRecipe;
-import com.github.bartimaeusnek.bartworks.MainMod;
-import cpw.mods.fml.common.event.FMLInterModComms;
-import gregtech.api.util.GT_Recipe;
-import gregtech.nei.GT_NEI_DefaultHandler;
-
-public class BW_NEI_HTGRHandler extends GT_NEI_DefaultHandler {
- public BW_NEI_HTGRHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
- super(aRecipeMap);
- if (!NEI_BW_Config.sIsAdded) {
- FMLInterModComms.sendRuntimeMessage(
- MainMod.instance,
- "NEIPlugins",
- "register-crafting-handler",
- "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
- GuiCraftingRecipe.craftinghandlers.add(this);
- GuiUsageRecipe.usagehandlers.add(this);
- }
- }
-}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java
deleted file mode 100644
index 0ae2453934..0000000000
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/BW_NEI_RadHatchHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.github.bartimaeusnek.bartworks.neiHandler;
-
-import codechicken.nei.recipe.GuiCraftingRecipe;
-import codechicken.nei.recipe.GuiUsageRecipe;
-import codechicken.nei.recipe.TemplateRecipeHandler;
-import com.github.bartimaeusnek.bartworks.MainMod;
-import cpw.mods.fml.common.event.FMLInterModComms;
-import gregtech.api.util.GT_Recipe;
-import gregtech.nei.GT_NEI_DefaultHandler;
-import net.minecraft.util.StatCollector;
-
-public class BW_NEI_RadHatchHandler extends GT_NEI_DefaultHandler {
-
- public BW_NEI_RadHatchHandler(GT_Recipe.GT_Recipe_Map aRecipeMap) {
- super(aRecipeMap);
- if (!NEI_BW_Config.sIsAdded) {
- FMLInterModComms.sendRuntimeMessage(
- MainMod.instance,
- "NEIPlugins",
- "register-crafting-handler",
- "bartworks@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
- GuiCraftingRecipe.craftinghandlers.add(this);
- GuiUsageRecipe.usagehandlers.add(this);
- }
- }
-
- @Override
- public TemplateRecipeHandler newInstance() {
- return new BW_NEI_RadHatchHandler(this.mRecipeMap);
- }
-
- @Override
- public void drawExtras(int aRecipeIndex) {
- GT_Recipe recipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe;
- int radioLevel = recipe.mEUt;
- int amount = recipe.mDuration;
- long time = recipe.mSpecialValue;
- int y = getDescriptionYOffset();
- drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel), -16777216);
- y += 10;
- drawText(10, y, StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount), -16777216);
- y += 10;
- drawText(
- 10,
- y,
- StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0),
- -16777216);
- }
-}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java
index de9aa9b70b..f14b220e52 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/neiHandler/NEI_BW_Config.java
@@ -28,7 +28,6 @@ import codechicken.nei.api.IConfigureNEI;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.loaders.FluidLoader;
import com.github.bartimaeusnek.bartworks.common.loaders.ItemRegistry;
-import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_HTGR;
import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader;
import com.github.bartimaeusnek.bartworks.util.BWRecipes;
import gregtech.api.enums.OrePrefixes;
@@ -89,8 +88,6 @@ public class NEI_BW_Config implements IConfigureNEI {
new BW_NEI_OreHandler();
new BW_NEI_BioVatHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BACTERIALVATBYTE));
new BW_NEI_BioLabHandler(BWRecipes.instance.getMappingsFor(BWRecipes.BIOLABBYTE));
- new BW_NEI_RadHatchHandler(BWRecipes.instance.getMappingsFor(BWRecipes.RADHATCH));
- new BW_NEI_HTGRHandler(GT_TileEntity_HTGR.fakeRecipeMap);
NEI_BW_Config.sIsAdded = true;
}
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
index 1b95d363df..25f4a0e523 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/util/BWRecipes.java
@@ -28,6 +28,7 @@ import static com.github.bartimaeusnek.bartworks.util.BW_Util.specialToByte;
import com.github.bartimaeusnek.bartworks.API.modularUI.BW_UITextures;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.common.loaders.BioItemList;
+import com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_BioVat;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
@@ -41,6 +42,7 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.nei.NEIRecipeInfo;
import ic2.core.Ic2Items;
import ic2.core.item.ItemFluidCell;
import java.util.*;
@@ -126,7 +128,16 @@ public class BWRecipes {
true,
false // special handler
)
- .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE);
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE)
+ .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> {
+ int[] tSpecialA = GT_TileEntity_BioVat.specialValueUnpack(recipeInfo.recipe.mSpecialValue);
+ return Arrays.asList(
+ StatCollector.translateToLocal("nei.biovat.0.name") + " " + tSpecialA[0],
+ (tSpecialA[2] == 1
+ ? StatCollector.translateToLocal("nei.biovat.1.name")
+ : StatCollector.translateToLocal("nei.biovat.2.name"))
+ + applyPrefixAndSuffix.apply(tSpecialA[3]));
+ });
private final GT_Recipe.GT_Recipe_Map sAcidGenFuels = new BW_Recipe_Map_LiquidFuel(
new HashSet<>(10),
"bw.fuels.acidgens",
@@ -176,8 +187,7 @@ public class BWRecipes {
0,
"",
false,
- false // special handler
- ) {
+ true) {
@Override
public void addProgressBarUI(
ModularWindow.Builder builder, Supplier<Float> progressSupplier, Pos2d windowOffset) {
@@ -186,10 +196,25 @@ public class BWRecipes {
.setPos(new Pos2d(74, 20).add(windowOffset))
.setSize(29, 27));
}
+
+ @Override
+ protected void drawNEIEnergyInfo(NEIRecipeInfo recipeInfo) {}
+
+ @Override
+ protected void drawNEIDurationInfo(NEIRecipeInfo recipeInfo) {}
}.setSlotOverlay(false, false, BW_UITextures.OVERLAY_SLOT_ROD)
.setLogo(BW_UITextures.PICTURE_BW_LOGO_47X21)
.setLogoPos(118, 55)
- .setLogoSize(47, 21);
+ .setLogoSize(47, 21)
+ .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> {
+ int radioLevel = recipeInfo.recipe.mEUt;
+ int amount = recipeInfo.recipe.mDuration;
+ long time = recipeInfo.recipe.mSpecialValue;
+ return Arrays.asList(
+ StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.0", radioLevel),
+ StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.1", amount),
+ StatCollector.translateToLocalFormatted("BW.NEI.display.radhatch.2", time * amount / 20.0));
+ });
/**
* @param machine 0 = biolab; 1 = BacterialVat; 2 = sAcidGenFuels; 3 = circuitAssemblyLine