diff options
author | Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> | 2024-01-01 07:48:34 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-01 14:48:34 +0100 |
commit | 7645fd98133a45896418b669693956f26a6780f8 (patch) | |
tree | 33a6f51fc5703fd86c6184001ed4f00128f4e97f /src/main/java/gtPlusPlus/api/recipe | |
parent | a752823226b618f4a54520f83bb937fcc4df1948 (diff) | |
download | GT5-Unofficial-7645fd98133a45896418b669693956f26a6780f8.tar.gz GT5-Unofficial-7645fd98133a45896418b669693956f26a6780f8.tar.bz2 GT5-Unofficial-7645fd98133a45896418b669693956f26a6780f8.zip |
Thermal Boiler rework (#815)
* Migrate recipes to RA. Fix oredict of outputs.
* New recipe UI for NEI.
* Reworked processing logic.
* Display EU/t in WAILA + misc fixes
* Small spelling updates.
* Full rework of recipes.
* Reverted Pyrotheum recipe.
* Restored old recipes + cleanup.
Diffstat (limited to 'src/main/java/gtPlusPlus/api/recipe')
-rw-r--r-- | src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java | 2 | ||||
-rw-r--r-- | src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java | 60 |
2 files changed, 61 insertions, 1 deletions
diff --git a/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java index 9d02865c5b..3977d69fe7 100644 --- a/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java +++ b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java @@ -115,7 +115,7 @@ public class GTPPRecipeMaps { .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(9, 9, 3, 3).frontend(LargeNEIFrontend::new).build(); + .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( 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..9c78519765 --- /dev/null +++ b/src/main/java/gtPlusPlus/api/recipe/ThermalBoilerFrontend.java @@ -0,0 +1,60 @@ +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; + } + } +} |