aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/api/recipe
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
committerRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
commit6d1b2216464d4dad449ac6fcfec476832224a55e (patch)
tree526a0c15f7056313c80e6c0386e025e9b3f61781 /src/main/java/gtPlusPlus/api/recipe
parentb5d35f40afa606ed1b07061dad82e0521a59c186 (diff)
downloadGT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.gz
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.bz2
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.zip
Merge addon sources
Diffstat (limited to 'src/main/java/gtPlusPlus/api/recipe')
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/ChemicalPlantFrontend.java68
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java17
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java232
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/MillingFrontend.java46
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/TGSFrontend.java147
-rw-r--r--src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java57
6 files changed, 567 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/api/recipe/ChemicalPlantFrontend.java b/src/main/java/gtPlusPlus/api/recipe/ChemicalPlantFrontend.java
new file mode 100644
index 0000000000..beede78173
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/ChemicalPlantFrontend.java
@@ -0,0 +1,68 @@
+package gtPlusPlus.api.recipe;
+
+import static net.minecraft.util.EnumChatFormatting.GRAY;
+
+import java.util.List;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+
+import gregtech.api.recipe.BasicUIPropertiesBuilder;
+import gregtech.api.recipe.NEIRecipePropertiesBuilder;
+import gregtech.api.recipe.RecipeMapFrontend;
+import gregtech.api.util.MethodsReturnNonnullByDefault;
+import gregtech.common.gui.modularui.UIHelper;
+import gregtech.nei.GT_NEI_DefaultHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+
+@ParametersAreNonnullByDefault
+@MethodsReturnNonnullByDefault
+public class ChemicalPlantFrontend extends RecipeMapFrontend {
+
+ public ChemicalPlantFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
+ NEIRecipePropertiesBuilder neiPropertiesBuilder) {
+ super(uiPropertiesBuilder, neiPropertiesBuilder);
+ }
+
+ @Override
+ public List<Pos2d> getItemInputPositions(int itemInputCount) {
+ return UIHelper.getGridPositions(itemInputCount, 7, 6, itemInputCount, 1);
+ }
+
+ @Override
+ public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
+ return UIHelper.getGridPositions(itemOutputCount, 106, 6, 2);
+ }
+
+ @Override
+ public List<Pos2d> getFluidInputPositions(int fluidInputCount) {
+ return UIHelper.getGridPositions(fluidInputCount, 7, 41, fluidInputCount, 1);
+ }
+
+ @Override
+ public List<Pos2d> getFluidOutputPositions(int fluidOutputCount) {
+ return UIHelper.getGridPositions(fluidOutputCount, 142, 6, 1, fluidOutputCount);
+ }
+
+ @Override
+ protected List<String> handleNEIItemInputTooltip(List<String> currentTip,
+ GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
+ if (ItemUtils.isCatalyst(pStack.item)) {
+ currentTip.add(GRAY + "Does not always get consumed in the process");
+ currentTip.add(GRAY + "Higher tier pipe casings allow this item to last longer");
+ } else {
+ super.handleNEIItemInputTooltip(currentTip, pStack);
+ }
+ return currentTip;
+ }
+
+ @Override
+ protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) {
+ if (ItemUtils.isCatalyst(stack.item)) {
+ drawNEIOverlayText("NC*", stack);
+ } else {
+ super.drawNEIOverlayForInput(stack);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java
new file mode 100644
index 0000000000..310f6f540d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java
@@ -0,0 +1,17 @@
+package gtPlusPlus.api.recipe;
+
+import static gregtech.api.recipe.RecipeCategory.createIcon;
+
+import gregtech.api.enums.Mods;
+import gregtech.api.recipe.RecipeCategory;
+import gregtech.api.recipe.RecipeCategoryHolder;
+
+public class GTPPRecipeCategories {
+
+ @RecipeCategoryHolder
+ public static final RecipeCategory absNonAlloyRecipes = new RecipeCategory(
+ "gtpp.recipe.category.abs_non_alloy_recipes",
+ GTPPRecipeMaps.alloyBlastSmelterRecipes,
+ builder -> builder.setDisplayImage(
+ createIcon(Mods.GTPlusPlus.getResourcePath("textures", "gui", "picture", "abs_non_alloy_recipes.png"))));
+}
diff --git a/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java
new file mode 100644
index 0000000000..d2171d1bdd
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java
@@ -0,0 +1,232 @@
+package gtPlusPlus.api.recipe;
+
+import java.util.Arrays;
+import java.util.Collections;
+
+import net.minecraft.util.StatCollector;
+
+import com.gtnewhorizons.modularui.common.widget.ProgressBar;
+
+import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.recipe.RecipeMap;
+import gregtech.api.recipe.RecipeMapBackend;
+import gregtech.api.recipe.RecipeMapBuilder;
+import gregtech.api.recipe.maps.FluidOnlyFrontend;
+import gregtech.api.recipe.maps.FuelBackend;
+import gregtech.api.recipe.maps.LargeNEIFrontend;
+import gregtech.api.util.GT_Utility;
+import gregtech.nei.formatter.FuelSpecialValueFormatter;
+import gregtech.nei.formatter.HeatingCoilSpecialValueFormatter;
+import gregtech.nei.formatter.SimpleSpecialValueFormatter;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntityTreeFarm;
+
+public class GTPPRecipeMaps {
+
+ public static final RecipeMap<RecipeMapBackend> cokeOvenRecipes = RecipeMapBuilder.of("gtpp.recipe.cokeoven")
+ .maxIO(2, 9, 1, 1)
+ .minInputs(1, 0)
+ .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> multiblockMassFabricatorRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.matterfab2")
+ .maxIO(2, 0, 1, 1)
+ .build();
+ public static final RecipeMap<FuelBackend> rocketFuels = RecipeMapBuilder
+ .of("gtpp.recipe.rocketenginefuel", FuelBackend::new)
+ .maxIO(0, 0, 1, 0)
+ .neiSpecialInfoFormatter(
+ recipeInfo -> Collections.singletonList(
+ StatCollector.translateToLocalFormatted(
+ "GT5U.nei.fuel",
+ GT_Utility.formatNumbers(recipeInfo.recipe.mSpecialValue * 3000L))))
+ .build();
+ public static final RecipeMap<RecipeMapBackend> quantumForceTransformerRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.quantumforcesmelter")
+ .maxIO(6, 6, 6, 6)
+ .minInputs(1, 0)
+ .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE)
+ .neiSpecialInfoFormatter(new SimpleSpecialValueFormatter("GT5U.nei.tier"))
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> chemicalDehydratorRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.chemicaldehydrator")
+ .maxIO(2, 9, 1, 1)
+ .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> vacuumFurnaceRecipes = RecipeMapBuilder.of("gtpp.recipe.vacfurnace")
+ .maxIO(9, 9, 3, 3)
+ .minInputs(1, 0)
+ .neiSpecialInfoFormatter(HeatingCoilSpecialValueFormatter.INSTANCE)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> alloyBlastSmelterRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.alloyblastsmelter")
+ .maxIO(9, 9, 3, 3)
+ .minInputs(1, 0)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> liquidFluorineThoriumReactorRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.lftr")
+ .maxIO(0, 0, 6, 6)
+ .minInputs(0, 2)
+ .frontend(FluidOnlyFrontend::new)
+ .neiSpecialInfoFormatter(recipeInfo -> {
+ final long eut = recipeInfo.recipe.mSpecialValue;
+ final int duration = recipeInfo.recipe.mDuration;
+ return Arrays.asList(
+ StatCollector.translateToLocalFormatted("gtpp.nei.lftr.power", GT_Utility.formatNumbers(eut)),
+ StatCollector
+ .translateToLocalFormatted("gtpp.nei.lftr.dynamo", MathUtils.formatNumbers(duration * eut)),
+ StatCollector
+ .translateToLocalFormatted("gtpp.nei.lftr.total", MathUtils.formatNumbers(duration * eut * 4)));
+ })
+ .build();
+ public static final RecipeMap<RecipeMapBackend> nuclearSaltProcessingPlantRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.nuclearsaltprocessingplant")
+ .maxIO(1, 6, 2, 3)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> millingRecipes = RecipeMapBuilder.of("gtpp.recipe.oremill")
+ .maxIO(3, 1, 0, 0)
+ .minInputs(1, 0)
+ .frontend(MillingFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> fissionFuelProcessingRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.fissionfuel")
+ .maxIO(0, 0, 6, 1)
+ .frontend(FluidOnlyFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> coldTrapRecipes = RecipeMapBuilder.of("gtpp.recipe.coldtrap")
+ .maxIO(2, 9, 1, 1)
+ .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> reactorProcessingUnitRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.reactorprocessingunit")
+ .maxIO(2, 9, 1, 1)
+ .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> simpleWasherRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.simplewasher")
+ .maxIO(1, 1, 1, 0)
+ .slotOverlays(
+ (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CAULDRON : null)
+ .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> molecularTransformerRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.moleculartransformer")
+ .maxIO(1, 1, 0, 0)
+ .slotOverlays(
+ (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_MICROSCOPE
+ : null)
+ .neiHandlerInfo(
+ builder -> builder
+ .setDisplayStack(ItemUtils.getItemStackFromFQRN("AdvancedSolarPanel:BlockMolecularTransformer", 1)))
+ .build();
+ public static final RecipeMap<RecipeMapBackend> chemicalPlantRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.fluidchemicaleactor")
+ .maxIO(4, 6, 4, 3)
+ .slotOverlays((index, isFluid, isOutput, isSpecial) -> {
+ if (isFluid) {
+ if (isOutput) {
+ return GT_UITextures.OVERLAY_SLOT_VIAL_2;
+ }
+ return GT_UITextures.OVERLAY_SLOT_MOLECULAR_3;
+ }
+ if (isOutput) {
+ return GT_UITextures.OVERLAY_SLOT_VIAL_1;
+ }
+ return GT_UITextures.OVERLAY_SLOT_MOLECULAR_1;
+ })
+ .progressBar(GTPP_UITextures.PROGRESSBAR_FLUID_REACTOR, ProgressBar.Direction.CIRCULAR_CW)
+ .progressBarPos(82, 24)
+ .neiSpecialInfoFormatter(recipeInfo -> {
+ int tier = recipeInfo.recipe.mSpecialValue + 1;
+ String materialName = StatCollector.translateToLocal("gtpp.nei.chemplant.tier." + tier);
+ return Collections
+ .singletonList(StatCollector.translateToLocalFormatted("GT5U.nei.tier", tier + " - " + materialName));
+ })
+ .frontend(ChemicalPlantFrontend::new)
+ .build();
+ public static final RecipeMap<FuelBackend> rtgFuels = RecipeMapBuilder
+ .of("gtpp.recipe.RTGgenerators", FuelBackend::new)
+ .maxIO(1, 0, 0, 0)
+ .neiSpecialInfoFormatter(new SimpleSpecialValueFormatter("gtpp.nei.rtg.days", 365))
+ .build();
+ public static final RecipeMap<RecipeMapBackend> thermalBoilerRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.thermalgeneratorfuel")
+ .maxIO(0, 9, 2, 3)
+ .frontend(ThermalBoilerFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> solarTowerRecipes = RecipeMapBuilder.of("gtpp.recipe.solartower")
+ .maxIO(0, 0, 1, 1)
+ .neiSpecialInfoFormatter(
+ recipeInfo -> Arrays.asList(
+ StatCollector.translateToLocal("gtpp.nei.solar_tower.1"),
+ StatCollector.translateToLocal("gtpp.nei.solar_tower.2"),
+ StatCollector.translateToLocal("gtpp.nei.solar_tower.3")))
+ .frontend(FluidOnlyFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> cyclotronRecipes = RecipeMapBuilder.of("gtpp.recipe.cyclotron")
+ .maxIO(9, 9, 1, 1)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> fishPondRecipes = RecipeMapBuilder.of("gtpp.recipe.fishpond")
+ .maxIO(1, 1, 0, 0)
+ .slotOverlays(
+ (index, isFluid, isOutput, isSpecial) -> !isFluid && !isOutput ? GT_UITextures.OVERLAY_SLOT_CAULDRON : null)
+ .progressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> spargeTowerFakeRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.spargetower")
+ .maxIO(0, 0, 9, 9)
+ .disableRegisterNEI()
+ .build();
+ public static final RecipeMap<RecipeMapBackend> advancedFreezerRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.cryogenicfreezer")
+ .maxIO(1, 1, 2, 1)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> centrifugeNonCellRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.multicentrifuge")
+ .maxIO(6, 6, 6, 6)
+ .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> electrolyzerNonCellRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.multielectro")
+ .maxIO(6, 6, 6, 6)
+ .progressBar(GT_UITextures.PROGRESSBAR_EXTRACT)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> mixerNonCellRecipes = RecipeMapBuilder.of("gtpp.recipe.multimixer")
+ .maxIO(9, 9, 6, 6)
+ .progressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> chemicalDehydratorNonCellRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.multidehydrator")
+ .maxIO(6, 9, 3, 3)
+ .frontend(LargeNEIFrontend::new)
+ .build();
+ public static final RecipeMap<FuelBackend> semiFluidFuels = RecipeMapBuilder
+ .of("gtpp.recipe.semifluidgeneratorfuels", FuelBackend::new)
+ .maxIO(0, 0, 1, 0)
+ .neiSpecialInfoFormatter(FuelSpecialValueFormatter.INSTANCE)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> flotationCellRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.flotationcell")
+ .maxIO(6, 0, 1, 1)
+ .build();
+ public static final RecipeMap<RecipeMapBackend> treeGrowthSimulatorFakeRecipes = RecipeMapBuilder
+ .of("gtpp.recipe.treefarm")
+ .maxIO(
+ GregtechMetaTileEntityTreeFarm.Mode.values().length,
+ GregtechMetaTileEntityTreeFarm.Mode.values().length,
+ 0,
+ 0)
+ .minInputs(1, 0)
+ .useSpecialSlot()
+ .frontend(TGSFrontend::new)
+ .build();
+}
diff --git a/src/main/java/gtPlusPlus/api/recipe/MillingFrontend.java b/src/main/java/gtPlusPlus/api/recipe/MillingFrontend.java
new file mode 100644
index 0000000000..26e2ab2ec9
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/MillingFrontend.java
@@ -0,0 +1,46 @@
+package gtPlusPlus.api.recipe;
+
+import static net.minecraft.util.EnumChatFormatting.GRAY;
+
+import java.util.List;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import net.minecraft.util.StatCollector;
+
+import gregtech.api.recipe.BasicUIPropertiesBuilder;
+import gregtech.api.recipe.NEIRecipePropertiesBuilder;
+import gregtech.api.recipe.RecipeMapFrontend;
+import gregtech.api.util.MethodsReturnNonnullByDefault;
+import gregtech.nei.GT_NEI_DefaultHandler;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+
+@ParametersAreNonnullByDefault
+@MethodsReturnNonnullByDefault
+public class MillingFrontend extends RecipeMapFrontend {
+
+ public MillingFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
+ NEIRecipePropertiesBuilder neiPropertiesBuilder) {
+ super(uiPropertiesBuilder, neiPropertiesBuilder);
+ }
+
+ @Override
+ protected List<String> handleNEIItemInputTooltip(List<String> currentTip,
+ GT_NEI_DefaultHandler.FixedPositionedStack pStack) {
+ if (ItemUtils.isMillingBall(pStack.item)) {
+ currentTip.add(GRAY + StatCollector.translateToLocal("gtpp.nei.milling.not_consumed"));
+ } else {
+ super.handleNEIItemInputTooltip(currentTip, pStack);
+ }
+ return currentTip;
+ }
+
+ @Override
+ protected void drawNEIOverlayForInput(GT_NEI_DefaultHandler.FixedPositionedStack stack) {
+ if (ItemUtils.isMillingBall(stack.item)) {
+ drawNEIOverlayText("NC*", stack);
+ } else {
+ super.drawNEIOverlayForInput(stack);
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/recipe/TGSFrontend.java b/src/main/java/gtPlusPlus/api/recipe/TGSFrontend.java
new file mode 100644
index 0000000000..e57ebaf5f9
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/TGSFrontend.java
@@ -0,0 +1,147 @@
+package gtPlusPlus.api.recipe;
+
+import java.awt.Rectangle;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+
+import gregtech.api.recipe.BasicUIPropertiesBuilder;
+import gregtech.api.recipe.NEIRecipePropertiesBuilder;
+import gregtech.api.recipe.RecipeMapFrontend;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.MethodsReturnNonnullByDefault;
+import gregtech.common.gui.modularui.UIHelper;
+import gregtech.nei.GT_NEI_DefaultHandler;
+import gregtech.nei.RecipeDisplayInfo;
+import gregtech.nei.formatter.INEISpecialInfoFormatter;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntityTreeFarm;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntityTreeFarm.Mode;
+
+@ParametersAreNonnullByDefault
+@MethodsReturnNonnullByDefault
+public class TGSFrontend extends RecipeMapFrontend {
+
+ private static final int SLOT_SIZE = 18;
+ private static final int CENTER_X = 90;
+ private static final int SPECIAL_X = CENTER_X - SLOT_SIZE / 2;
+ private static final int SPECIAL_Y = 9;
+ private static final int INPUTS_X = CENTER_X - SLOT_SIZE * 3;
+ private static final int INPUTS_Y = SPECIAL_Y + SLOT_SIZE + SLOT_SIZE / 2;
+ private static final int OUTPUTS_X = CENTER_X + SLOT_SIZE;
+ private static final int OUTPUTS_Y = INPUTS_Y;
+
+ public TGSFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder, NEIRecipePropertiesBuilder neiPropertiesBuilder) {
+ super(
+ uiPropertiesBuilder
+ .addNEITransferRect(
+ new Rectangle(INPUTS_X + SLOT_SIZE * 2, INPUTS_Y + SLOT_SIZE / 2, SLOT_SIZE * 2, SLOT_SIZE))
+ .progressBarPos(new Pos2d(CENTER_X - 10, INPUTS_Y + SLOT_SIZE / 2)),
+ neiPropertiesBuilder.neiSpecialInfoFormatter(new TGSSpecialValueFormatter()));
+ }
+
+ @Override
+ protected void drawEnergyInfo(RecipeDisplayInfo recipeInfo) {
+ // Do not.
+ }
+
+ @Override
+ public Pos2d getSpecialItemPosition() {
+ return new Pos2d(SPECIAL_X, SPECIAL_Y);
+ }
+
+ @Override
+ public List<Pos2d> getItemInputPositions(int itemInputCount) {
+ return UIHelper.getGridPositions(Mode.values().length, INPUTS_X, INPUTS_Y, 2);
+ }
+
+ @Override
+ public List<Pos2d> getItemOutputPositions(int itemOutputCount) {
+ return UIHelper.getGridPositions(Mode.values().length, OUTPUTS_X, OUTPUTS_Y, 2);
+ }
+
+ private static final String[] tooltipInputs = { StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.saw"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.cutter"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.shears"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.knife") };
+
+ private static final String[] tooltipOutputs = { StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.needsSaw"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.needsCutter"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.needsShears"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.needsKnife") };
+ private static final String tooltipSapling = StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.sapling");
+ private static final String tooltipMultiplier = StatCollector.translateToLocal("gtpp.nei.tgs.tooltip.multiplier");
+
+ @Override
+ public List<String> handleNEIItemTooltip(ItemStack stack, List<String> currentTip,
+ GT_NEI_DefaultHandler.CachedDefaultRecipe neiCachedRecipe) {
+
+ /*
+ * This gets a little complicated, because we want to assign tooltips to inputs/outputs based on which mode
+ * (saw, shears, etc.) they correspond to. But CachedDefaultRecipe does not retain this information for us. This
+ * is because some recipes don't output any items for some modes. For example, if a recipe only yields logs and
+ * leaves, then the outputs of GT_Recipe will be {log, null, leaves}. However, in CachedDefaultRecipe this gets
+ * condensed to just {log, leaves}, with null values omitted. So to figure out which item came from which mode,
+ * we need to step through both of these arrays simultaneously and match non-null inputs/outputs in GT_Recipe to
+ * inputs/outputs in CachedDefaultRecipe.
+ */
+
+ // The last input in neiCachedRecipe is always the special slot, this is the input sapling.
+ if (stack == neiCachedRecipe.mInputs.get(neiCachedRecipe.mInputs.size() - 1).item) {
+ currentTip.add(EnumChatFormatting.YELLOW + tooltipSapling);
+ super.handleNEIItemTooltip(stack, currentTip, neiCachedRecipe);
+ return currentTip;
+ }
+
+ GT_Recipe.GT_Recipe_WithAlt recipe = (GT_Recipe.GT_Recipe_WithAlt) neiCachedRecipe.mRecipe;
+
+ // Inputs
+ int slot = 0;
+ for (int mode = 0; mode < Mode.values().length; ++mode) {
+ if (mode < recipe.mOreDictAlt.length && recipe.mOreDictAlt[mode] != null) {
+ // There is a valid input in this mode.
+ if (slot < neiCachedRecipe.mInputs.size() && stack == neiCachedRecipe.mInputs.get(slot).item) {
+ int toolMultiplier = GregtechMetaTileEntityTreeFarm.getToolMultiplier(stack, Mode.values()[mode]);
+ currentTip.add(EnumChatFormatting.YELLOW + tooltipInputs[mode]);
+ if (toolMultiplier > 0) {
+ currentTip.add(EnumChatFormatting.YELLOW + tooltipMultiplier + " " + toolMultiplier + "x");
+ }
+ return currentTip;
+ }
+ ++slot;
+ }
+ }
+
+ // Outputs
+ slot = 0;
+ for (int mode = 0; mode < Mode.values().length; ++mode) {
+ if (mode < recipe.mOutputs.length && recipe.mOutputs[mode] != null) {
+ // There is a valid output in this mode.
+ if (slot < neiCachedRecipe.mOutputs.size() && stack == neiCachedRecipe.mOutputs.get(slot).item) {
+ currentTip.add(EnumChatFormatting.YELLOW + tooltipOutputs[mode]);
+ return currentTip;
+ }
+ ++slot;
+ }
+ }
+
+ return currentTip;
+ }
+
+ private static class TGSSpecialValueFormatter implements INEISpecialInfoFormatter {
+
+ @Override
+ public List<String> format(RecipeDisplayInfo recipeInfo) {
+ return Arrays.asList(
+ StatCollector.translateToLocal("gtpp.nei.tgs.info-1"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.info-2"),
+ StatCollector.translateToLocal("gtpp.nei.tgs.info-3"));
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java b/src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java
new file mode 100644
index 0000000000..93974b9f9a
--- /dev/null
+++ b/src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java
@@ -0,0 +1,57 @@
+package gtPlusPlus.api.recipe;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.ParametersAreNonnullByDefault;
+
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+
+import gregtech.api.recipe.BasicUIPropertiesBuilder;
+import gregtech.api.recipe.NEIRecipePropertiesBuilder;
+import gregtech.api.recipe.maps.LargeNEIFrontend;
+import gregtech.api.util.MethodsReturnNonnullByDefault;
+import gregtech.common.gui.modularui.UIHelper;
+import gregtech.nei.RecipeDisplayInfo;
+import gregtech.nei.formatter.INEISpecialInfoFormatter;
+
+@ParametersAreNonnullByDefault
+@MethodsReturnNonnullByDefault
+public class ThermalBoilerFrontend extends LargeNEIFrontend {
+
+ private static final int tileSize = 18;
+ private static final int xOrigin = 16;
+ private static final int yOrigin = 8 + tileSize; // Aligned with second row of output items.
+ private static final int maxInputs = 3;
+
+ public ThermalBoilerFrontend(BasicUIPropertiesBuilder uiPropertiesBuilder,
+ NEIRecipePropertiesBuilder neiPropertiesBuilder) {
+ super(
+ uiPropertiesBuilder,
+ neiPropertiesBuilder.neiSpecialInfoFormatter(new ThermalBoilerSpecialValueFormatter()));
+ }
+
+ @Override
+ public List<Pos2d> getFluidInputPositions(int fluidInputCount) {
+ return UIHelper
+ .getGridPositions(fluidInputCount, xOrigin + tileSize * (maxInputs - fluidInputCount), yOrigin, maxInputs);
+ }
+
+ private static class ThermalBoilerSpecialValueFormatter implements INEISpecialInfoFormatter {
+
+ @Override
+ public List<String> format(RecipeDisplayInfo recipeInfo) {
+ // TODO: Translation.
+ List<String> result = new ArrayList<>();
+ result.add("Steam output shown");
+ result.add("at maximum efficiency.");
+
+ if (recipeInfo.recipe.mSpecialValue == -1) {
+ result.add("Without a Lava Filter,");
+ result.add("only Obsidian is produced.");
+ }
+
+ return result;
+ }
+ }
+}