From b6caaf255da083516286321155ef339b60a07393 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 4 Dec 2023 06:26:09 +0900 Subject: Migrate to new RecipeMap (#788) * Remove reference to GTPP_Recipe itself * Remove GTPP_Recipe_Map_Internal * Move recipemaps to separated class * Remove unused recipemaps * Migrate GT++ recipemaps Remove sElementalDuplicatorRecipes in favor of GT replicatorRecipes supporting findRecipe * Migrate the rest * Adjust catalyst priorities * Add ABS non-alloy recipe category * Remove s prefixes from recipemaps * Adapt to GT_StreamUtil rename * Adjust recipe catalysts * Fix build * update gradle+bs+deps (cherry picked from commit 8b185c7a4d881d38580cc98456265ebb751b6d93) * update deps --------- Co-authored-by: Martin Robertz --- .../java/gregtech/api/util/AdvFusionPower.java | 43 - .../api/util/AdvancedFusionOverclockDescriber.java | 23 + .../java/gregtech/api/util/FishPondFakeRecipe.java | 5 +- src/main/java/gregtech/api/util/GTPP_Recipe.java | 877 --------------------- src/main/java/gregtech/api/util/HotFuel.java | 6 +- .../gregtech/api/util/SemiFluidFuelHandler.java | 17 +- src/main/java/gtPlusPlus/GTplusplus.java | 37 +- .../api/recipe/ChemicalPlantFrontend.java | 68 ++ .../api/recipe/GTPPRecipeCategories.java | 19 + .../java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java | 157 ++++ .../gtPlusPlus/api/recipe/MillingFrontend.java | 46 ++ .../java/gtPlusPlus/api/recipe/TGSFrontend.java | 68 ++ src/main/java/gtPlusPlus/core/item/ModItems.java | 4 +- .../core/item/base/ingots/BaseItemIngotHot.java | 4 +- .../core/item/base/ingots/BaseItemIngot_OLD.java | 4 +- .../core/item/chemistry/AgriculturalChem.java | 18 +- .../core/item/chemistry/GenericChem.java | 30 +- .../core/item/chemistry/RocketFuels.java | 33 +- .../java/gtPlusPlus/core/proxy/ClientProxy.java | 4 + .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 154 ++-- .../gtPlusPlus/core/recipe/RECIPES_General.java | 10 +- .../core/recipe/RECIPES_LaserEngraver.java | 24 +- .../core/recipe/RECIPES_RareEarthProcessing.java | 26 +- .../gtPlusPlus/core/util/minecraft/FluidUtils.java | 10 +- .../java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java | 2 +- src/main/java/gtPlusPlus/nei/NEI_GTPP_Config.java | 99 +++ src/main/java/gtPlusPlus/nei/NEI_GT_Config.java | 41 - src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java | 134 ---- .../gtPlusPlus/plugin/agrichem/BioRecipes.java | 74 +- .../gtPlusPlus/recipes/CokeAndPyrolyseOven.java | 3 +- .../java/gtPlusPlus/recipes/RecipeRemovals.java | 29 +- .../xmod/bop/blocks/BOP_Block_Registrator.java | 6 +- .../xmod/forestry/bees/custom/GTPP_Bees.java | 4 +- .../xmod/forestry/bees/custom/ItemCustomComb.java | 4 +- .../xmod/forestry/bees/items/output/GTPP_Drop.java | 4 +- .../forestry/bees/items/output/GTPP_Propolis.java | 4 +- .../java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 74 -- ...etaTileEntity_Hatch_ElementalDataOrbHolder.java | 3 - .../GT_MetaTileEntity_Hatch_InputBattery.java | 4 +- .../GT_MetaTileEntity_Hatch_Steam_BusInput.java | 4 +- .../base/GregtechMeta_MultiBlockBase.java | 22 +- .../base/GregtechMeta_SteamMultiBase.java | 8 +- .../GregtechRocketFuelGeneratorBase.java | 20 +- .../GT_MetaTileEntity_Hatch_NbtConsumable.java | 2 - .../GT_MetaTileEntity_SemiFluidGenerator.java | 10 +- .../GregtechMetaTileEntityGeothermalGenerator.java | 7 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 8 +- .../generators/GregtechMetaTileEntity_RTG.java | 13 +- .../basic/GregtechMetaTileEntity_AutoChisel.java | 30 +- .../machines/multi/misc/GMTE_AmazonPackager.java | 7 +- ...gtechMetaTileEntity_IndustrialAlloySmelter.java | 6 +- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 24 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 8 +- .../GregtechMetaTileEntity_IndustrialChisel.java | 33 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 8 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 23 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 19 +- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 7 +- .../GregtechMetaTileEntity_IndustrialExtruder.java | 12 +- ...egtechMetaTileEntity_IndustrialFluidHeater.java | 7 +- ...egtechMetaTileEntity_IndustrialForgeHammer.java | 7 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 12 +- .../GregtechMetaTileEntity_IndustrialMixer.java | 7 +- ...aTileEntity_IndustrialMolecularTransformer.java | 8 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 68 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 23 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 12 +- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 7 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 8 +- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 29 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 12 +- .../processing/GregtechMetaTileEntity_IsaMill.java | 8 +- ...hMetaTileEntity_NuclearSaltProcessingPlant.java | 6 +- .../GregtechMetaTileEntity_SpargeTower.java | 16 +- ...egtechMetaTileEntity_Adv_DistillationTower.java | 26 +- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 11 +- .../GregtechMetaTileEntity_Adv_Fusion_MK4.java | 34 +- .../GregtechMetaTileEntity_Adv_Fusion_MK5.java | 35 +- .../GregtechMetaTileEntity_Adv_Implosion.java | 12 +- .../GregtechMetaTileEntity_SteamCompressor.java | 6 +- .../GregtechMetaTileEntity_SteamMacerator.java | 6 +- .../multi/production/GT4Entity_AutoCrafter.java | 6 +- .../multi/production/GT4Entity_ThermalBoiler.java | 10 +- .../GregtechMTE_ElementalDuplicator.java | 211 +---- .../production/GregtechMTE_FrothFlotationCell.java | 7 +- .../production/GregtechMTE_NuclearReactor.java | 8 +- .../production/GregtechMetaTileEntityTreeFarm.java | 15 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 8 +- .../GregtechMetaTileEntity_Cyclotron.java | 8 +- ...egtechMetaTileEntity_IndustrialFishingPond.java | 9 +- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 55 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 10 +- ...techMetaTileEntity_LargeSemifluidGenerator.java | 4 +- .../GregtechMetaTileEntity_MassFabricator.java | 36 +- ...techMetaTileEntity_QuantumForceTransformer.java | 7 +- .../GregtechMetaTileEntity_Refinery.java | 8 +- .../GregtechMetaTileEntity_SolarTower.java | 8 +- .../algae/GregtechMTE_AlgaePondBase.java | 24 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 8 +- ...egTechMetaTileEntity_MegaAlloyBlastSmelter.java | 7 +- .../turbines/GT_MTE_LargeTurbine_Gas.java | 16 +- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 16 +- .../common/tools/TOOL_Gregtech_AngleGrinder.java | 14 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 27 +- .../loaders/RecipeGen_BlastSmelterGT_GTNH.java | 304 ++++--- .../gregtech/loaders/RecipeGen_FluidCanning.java | 32 +- .../RecipeGen_MultisUsingFluidInsteadOfCells.java | 15 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 6 +- .../loaders/misc/AddCustomMachineToPA.java | 5 +- .../loaders/recipe/RecipeLoader_AlgaeFarm.java | 3 +- .../loaders/recipe/RecipeLoader_ChemicalSkips.java | 4 +- .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 8 +- .../loaders/recipe/RecipeLoader_Nuclear.java | 26 +- .../recipe/RecipeLoader_NuclearFuelProcessing.java | 8 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 115 +-- .../registration/gregtech/GregtechDehydrator.java | 49 +- .../gregtech/GregtechIndustrialMassFabricator.java | 28 +- .../registration/gregtech/GregtechLFTR.java | 18 +- .../gregtech/GregtechSimpleWasher.java | 28 +- .../registration/gregtech/GregtechSolarTower.java | 4 +- .../xmod/pamsharvest/fishtrap/FishTrapHandler.java | 18 +- .../xmod/railcraft/HANDLER_Railcraft.java | 4 +- .../recipe/TF_Gregtech_Recipes.java | 18 +- 123 files changed, 1609 insertions(+), 2409 deletions(-) delete mode 100644 src/main/java/gregtech/api/util/AdvFusionPower.java create mode 100644 src/main/java/gregtech/api/util/AdvancedFusionOverclockDescriber.java delete mode 100644 src/main/java/gregtech/api/util/GTPP_Recipe.java create mode 100644 src/main/java/gtPlusPlus/api/recipe/ChemicalPlantFrontend.java create mode 100644 src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java create mode 100644 src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java create mode 100644 src/main/java/gtPlusPlus/api/recipe/MillingFrontend.java create mode 100644 src/main/java/gtPlusPlus/api/recipe/TGSFrontend.java create mode 100644 src/main/java/gtPlusPlus/nei/NEI_GTPP_Config.java delete mode 100644 src/main/java/gtPlusPlus/nei/NEI_GT_Config.java delete mode 100644 src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java (limited to 'src/main/java') diff --git a/src/main/java/gregtech/api/util/AdvFusionPower.java b/src/main/java/gregtech/api/util/AdvFusionPower.java deleted file mode 100644 index 2ea04d9e0d..0000000000 --- a/src/main/java/gregtech/api/util/AdvFusionPower.java +++ /dev/null @@ -1,43 +0,0 @@ -package gregtech.api.util; - -import static gregtech.api.enums.GT_Values.V; - -import gregtech.common.power.FusionPower; -import gregtech.nei.FusionSpecialValueFormatter; - -public class AdvFusionPower extends FusionPower { - - public AdvFusionPower(byte tier, int startupPower) { - super(tier, startupPower); - } - - @Override - public void computePowerUsageAndDuration(int euPerTick, int duration, int specialValue) { - originalVoltage = computeVoltageForEuRate(euPerTick); - recipeEuPerTick = euPerTick; - recipeDuration = duration; - // It's safe to assume fusion is above ULV. We put this as safety check here anyway - if (tier > 0) { - int maxPossibleOverclocks = FusionSpecialValueFormatter.getFusionTier(this.specialValue, V[tier - 1]) - - FusionSpecialValueFormatter.getFusionTier(specialValue, euPerTick); - // Isn't too low EUt check? - long tempEUt = Math.max(euPerTick, V[1]); - - recipeDuration = duration; - - while (tempEUt <= V[tier - 1] * (long) amperage && maxPossibleOverclocks-- > 0 && recipeDuration > 1) { - tempEUt <<= 2; // this actually controls overclocking - recipeDuration >>= 2; // this is effect of overclocking - } - if (tempEUt > Integer.MAX_VALUE - 1) { - recipeEuPerTick = Integer.MAX_VALUE - 1; - recipeDuration = Integer.MAX_VALUE - 1; - } else { - recipeEuPerTick = (int) tempEUt; - if (recipeEuPerTick == 0) recipeEuPerTick = 1; - if (recipeDuration == 0) recipeDuration = 1; // set time to 1 tick - } - } - wasOverclocked = checkIfOverclocked(); - } -} diff --git a/src/main/java/gregtech/api/util/AdvancedFusionOverclockDescriber.java b/src/main/java/gregtech/api/util/AdvancedFusionOverclockDescriber.java new file mode 100644 index 0000000000..7a6e609f93 --- /dev/null +++ b/src/main/java/gregtech/api/util/AdvancedFusionOverclockDescriber.java @@ -0,0 +1,23 @@ +package gregtech.api.util; + +import javax.annotation.ParametersAreNonnullByDefault; + +import gregtech.api.objects.overclockdescriber.FusionOverclockDescriber; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +public class AdvancedFusionOverclockDescriber extends FusionOverclockDescriber { + + public AdvancedFusionOverclockDescriber(byte energyTier, long capableStartup) { + super(energyTier, capableStartup); + } + + @Override + protected int getEUtIncreasePerOC() { + return 2; + } + + protected int getDurationDecreasePerOC() { + return 2; + } +} diff --git a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java index e6b754deb7..81403c1612 100644 --- a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java +++ b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java @@ -9,6 +9,7 @@ import net.minecraftforge.fluids.FluidStack; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -59,7 +60,7 @@ public class FishPondFakeRecipe { } public static void addNewFishPondLoot(int circuit, ItemStack[] outputItems, int[] chances) { - GTPP_Recipe x = new GTPP_Recipe( + GT_Recipe x = new GT_Recipe( true, new ItemStack[] { CI.getNumberedCircuit(circuit) }, outputItems, @@ -71,6 +72,6 @@ public class FishPondFakeRecipe { 0, // No Eu produced 0); Logger.INFO("Fishing [" + circuit + "]: " + ItemUtils.getArrayStackNames(outputItems)); - GTPP_Recipe.GTPP_Recipe_Map.sFishPondRecipes.addRecipe(x, false, false, false); + GTPPRecipeMaps.fishPondRecipes.addRecipe(x, false, false, false); } } diff --git a/src/main/java/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java deleted file mode 100644 index 3058ea836e..0000000000 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ /dev/null @@ -1,877 +0,0 @@ -package gregtech.api.util; - -import static gregtech.api.enums.GT_Values.E; -import static net.minecraft.util.EnumChatFormatting.GRAY; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import com.gtnewhorizons.modularui.api.math.Pos2d; -import com.gtnewhorizons.modularui.common.widget.ProgressBar; -import com.gtnewhorizons.modularui.common.widget.ProgressBar.Direction; - -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.common.gui.modularui.UIHelper; -import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack; -import gregtech.nei.NEIRecipeInfo; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; - -/** - * Custom GT Recipe Class - * - * @author Alkalus - * - */ -public class GTPP_Recipe extends GT_Recipe { - - public GTPP_Recipe(final boolean aOptimize, final ItemStack[] aInputs, final ItemStack[] aOutputs, - final Object aSpecialItems, final int[] aChances, final FluidStack[] aFluidInputs, - final FluidStack[] aFluidOutputs, final int aDuration, final int aEUt, final int aSpecialValue) { - super( - aOptimize, - aInputs, - aOutputs, - aSpecialItems, - aChances, - aFluidInputs, - aFluidOutputs, - aDuration, - aEUt, - aSpecialValue); - // Logger.SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe]", "Created new recipe instance for - // "+ItemUtils.getArrayStackNames(aInputs), 167); - } - - public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final int aFuelValue, final int aType) { - this(aInput1, aOutput1, null, null, null, aFuelValue, aType); - } - - // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000! - public GTPP_Recipe(final ItemStack aInput1, final ItemStack aOutput1, final ItemStack aOutput2, - final ItemStack aOutput3, final ItemStack aOutput4, final int aSpecialValue, final int aType) { - this( - true, - new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, - null, - null, - null, - null, - 0, - 0, - Math.max(1, aSpecialValue)); - - Logger.WARNING("Switch case method for adding fuels"); - if ((this.mInputs.length > 0) && (aSpecialValue > 0)) { - switch (aType) { - // Diesel Generator - case 0: - Logger.WARNING("Added fuel " + aInput1.getDisplayName() + " is ROCKET FUEL - continuing"); - GTPP_Recipe_Map.sRocketFuels.addRecipe(this); - break; - // Gas Turbine - case 1: - GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(this); - break; - // Thermal Generator - case 2: - GTPP_Recipe_Map.sRTGFuels.addRecipe(this); - break; - // Plasma Generator - case 4: - // Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this); - break; - // Magic Generator - case 5: - // Gregtech_Recipe_Map.sMagicFuels.addRecipe(this); - break; - // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator - default: - // Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this); - break; - } - } - } - - /** - * Even though this is deprecated, it's still used to keep binary compatibility. (GoodGenerator and GTNHLanthanides - * reference to `sSimpleWasherRecipes` and `sChemicalDehydratorRecipes`) - */ - public static class GTPP_Recipe_Map_Internal extends GT_Recipe_Map { - - @Deprecated - public static final Collection sMappingsEx = new ArrayList<>(); - - public GTPP_Recipe_Map_Internal(Collection aRecipeList, String aUnlocalizedName, String aLocalName, - String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - } - } - - public static class GTPP_Recipe_Map { - - public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gtpp.recipe.cokeoven", - "Coke Oven", - null, - "", - 2, - 9, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN); - public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map( - new HashSet<>(200), - "gtpp.recipe.matterfab2", - "Matter Fabricator", - null, - "", - 2, - 0, - 0, - 0, - 1, - E, - 1, - E, - true, - true).useModularUI(true); - - public static final GT_Recipe_Map_Fuel sRocketFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(10), - "gtpp.recipe.rocketenginefuel", - "Rocket Engine Fuel", - null, - "", - 0, - 0, - 0, - 0, - 1, - "Fuel Value: ", - 3000, - " EU", - true, - true).useModularUI(true); - - public static final GT_Recipe_Map sQuantumForceTransformerRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(20), - "gtpp.recipe.quantumforcesmelter", - "Quantum Force Transformer", - null, - "", - 6, - 6, - 1, - 0, - 1, - "Tier: ", - 1, - E, - true, - true).useModularUI(true).setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE, Direction.RIGHT) - .setUsualFluidInputCount(6).setUsualFluidOutputCount(6); - - public static final GT_Recipe_Map sGeoThermalFuels = new GT_Recipe_Map( - new HashSet<>(10), - "gtpp.recipe.geothermalfuel", - "GeoThermal Fuel", - null, - "", - 1, - 1, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).useModularUI(true); - public static final GTPP_Recipe_Map_Internal sChemicalDehydratorRecipes = (GTPP_Recipe_Map_Internal) new GTPP_Recipe_Map_Internal( - new HashSet<>(200), - "gtpp.recipe.chemicaldehydrator", - "Dehydrator", - null, - "", - 2, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN); - public static final GT_Recipe_Map sVacuumFurnaceRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(500), - "gtpp.recipe.vacfurnace", - "Vacuum Furnace", - null, - "", - 9, - 9, - 1, - 0, - 1, - "Heat Capacity: ", - 1, - " K", - false, - true).setUsualFluidInputCount(3).setUsualFluidOutputCount(3); - public static final GT_Recipe_Map sAlloyBlastSmelterRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(200), - "gtpp.recipe.alloyblastsmelter", - "Alloy Blast Smelter", - null, - "", - 9, - 9, - 1, - 0, - 1, - E, - 1, - E, - true, - true).setUsualFluidInputCount(3).setUsualFluidOutputCount(3); - - // LFTR recipes - public static final GT_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GT_Recipe_Map_FluidOnly( - new HashSet<>(50), - "gtpp.recipe.lftr", - "Liquid Fluoride Thorium Reactor", - null, - "", - 0, - 0, - 0, - 2, - 0, - "Power: ", - 1, - " EU/t per Dynamo", - true, - true).setUsualFluidInputCount(6).setUsualFluidOutputCount(6) - .setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - final long tEUt = recipeInfo.recipe.mSpecialValue; - final int tDuration = recipeInfo.recipe.mDuration; - return Arrays.asList( - applyPrefixAndSuffix.apply(recipeInfo.recipe.mSpecialValue), - "Dynamo: " + MathUtils.formatNumbers(tDuration * tEUt) + " EU", - "Total: " + MathUtils.formatNumbers(tDuration * tEUt * 4) + " EU"); - }); - - public static final GT_Recipe_Map sNuclearSaltProcessingPlantRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(50), - "gtpp.recipe.nuclearsaltprocessingplant", - "Nuclear Salt Processing Plant", - null, - "", - 0, - 6, - 0, - 0, - 1, - "", - 0, - "", - true, - true).setUsualFluidInputCount(2).setUsualFluidOutputCount(3); - - // Ore Milling Map - public static final GT_Recipe_Map sOreMillRecipes = new GT_Recipe_Map( - new HashSet<>(10000), - "gtpp.recipe.oremill", - "Milling", - null, - "", - 3, - 3, - 1, - 0, - 1, - E, - 1, - E, - true, - true) { - - @Override - protected List handleNEIItemInputTooltip(List currentTip, FixedPositionedStack pStack) { - if (ItemUtils.isMillingBall(pStack.item)) { - currentTip.add(GRAY + "Does not always get consumed in the process"); - } else { - super.handleNEIItemInputTooltip(currentTip, pStack); - } - return currentTip; - } - - @Override - protected void drawNEIOverlayForInput(FixedPositionedStack stack) { - if (ItemUtils.isMillingBall(stack.item)) { - drawNEIOverlayText("NC*", stack); - } else { - super.drawNEIOverlayForInput(stack); - } - } - }.useModularUI(true); - - // Fission Fuel Plant Recipes - public static final GT_Recipe_Map sFissionFuelProcessing = new GT_Recipe_Map_FluidOnly( - new HashSet<>(50), - "gtpp.recipe.fissionfuel", - "Nuclear Fuel Processing", - null, - "", - 0, - 0, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setUsualFluidInputCount(6).setUsualFluidOutputCount(6); - - // Cold Trap - public static final GT_Recipe_Map sColdTrapRecipes = new GT_Recipe_Map( - new HashSet<>(10000), - "gtpp.recipe.coldtrap", - "Cold Trap", - null, - "", - 2, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN); - - // Reactor Processing Unit - public static final GT_Recipe_Map sReactorProcessingUnitRecipes = new GT_Recipe_Map( - new HashSet<>(10000), - "gtpp.recipe.reactorprocessingunit", - "Reactor Processing Unit", - null, - "", - 2, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setProgressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN); - - // Basic Washer Map - public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = (GTPP_Recipe_Map_Internal) new GTPP_Recipe_Map_Internal( - new HashSet<>(3), - "gtpp.recipe.simplewasher", - "Simple Dust Washer", - null, - "", - 1, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE); - - // Molecular Transformer Map - public static final GT_Recipe_Map sMolecularTransformerRecipes = new GT_Recipe_Map( - new HashSet<>(3), - "gtpp.recipe.moleculartransformer", - "Molecular Transformer", - null, - "", - 1, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE); - - // Elemental Duplicator Map - public static final GT_Recipe_Map sElementalDuplicatorRecipes = new GT_Recipe_Map( - new HashSet<>(3), - "gtpp.recipe.elementaldupe", - "Elemental Duplicator", - null, - "", - 1, - 1, - 0, - 1, - 1, - E, - 1, - E, - true, - false); - - public static final GT_Recipe_Map sChemicalPlantRecipes = new GTPP_Recipe_Map_ChemicalPlant( - new HashSet<>(100), - "gtpp.recipe.fluidchemicaleactor", - "Chemical Plant", - null, - "", - 4, - 4, - 0, - 0, - 1, - "Tier: ", - 1, - E, - true, - true); - - // RTG Fuel Map - public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(10), - "gtpp.recipe.RTGgenerators", - "RTG", - null, - "", - 1, - 0, - 0, - 0, - 1, - "Fuel Value: ", - 365, - " Minecraft Days", - true, - true).useModularUI(true); - - // Thermal Boiler map - public static final GT_Recipe_Map sThermalFuels = new GT_Recipe_Map_LargeNEI( - new HashSet<>(10), - "gtpp.recipe.thermalgeneratorfuel", - "Thermal Generator Fuel", - null, - "", - 9, - 9, - 0, - 0, - 1, - null, - 1000, - null, - true, - true).setUsualFluidInputCount(3).setUsualFluidOutputCount(3); - - // Solar Tower map - public static final GT_Recipe_Map sSolarTowerRecipes = new GT_Recipe_Map_FluidOnly( - new HashSet<>(10), - "gtpp.recipe.solartower", - "Solar Tower", - null, - "", - 0, - 0, - 0, - 0, - 1, - null, - 1000, - null, - true, - true).useModularUI(true).setNEISpecialInfoFormatter( - (recipeInfo, applyPrefixAndSuffix) -> Arrays.asList( - "Solar Heater rings boost tier", - "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", - "Input Amount = 1000 x T")); - - // Cyclotron recipe map - public static final GT_Recipe_Map sCyclotronRecipes = new GT_Recipe_Map( - new HashSet<>(200), - "gtpp.recipe.cyclotron", - "COMET - Compact Cyclotron", - null, - "", - 9, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - true).useModularUI(true); - - // Mini Fusion - public static final GT_Recipe_Map sSlowFusionRecipes = new GT_Recipe_Map( - new HashSet<>(50), - "gtpp.recipe.slowfusionreactor", - "Mimir - Slow Fusion", - null, - "", - 0, - 0, - 0, - 2, - 1, - "Start: ", - 1, - " EU", - true, - true).useModularUI(true); - - // Special Maps for Multis - public static final GT_Recipe_Map sFishPondRecipes = new GT_Recipe_Map( - new HashSet<>(3), - "gtpp.recipe.fishpond", - "Zhuhai - Fishing Port", - null, - "", - 1, - 1, - 0, - 0, - 1, - E, - 1, - E, - true, - true).setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CAULDRON) - .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW_MULTIPLE); - public static final GT_Recipe_Map sSpargeTowerRecipes = new GT_Recipe_Map( - new HashSet<>(10000), - "gtpp.recipe.spargetower", - "Sparging", - null, - "", - 9, - 9, - 0, - 0, - 1, - E, - 1, - E, - true, - false); - - public static final GT_Recipe_Map sAdvFreezerRecipes_GT = new GT_Recipe_Map( - new HashSet<>(2000), - "gtpp.recipe.cryogenicfreezer", - "Cryogenic Freezer", - null, - "", - 1, - 1, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setUsualFluidInputCount(2); - public static final GT_Recipe_Map sMultiblockCentrifugeRecipes_GT = new GT_Recipe_Map_LargeNEI( - new HashSet<>(2000), - "gtpp.recipe.multicentrifuge", - "Multiblock Centrifuge", - null, - "", - 6, - 6, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT).setUsualFluidInputCount(6) - .setUsualFluidOutputCount(6); - public static final GT_Recipe_Map sMultiblockElectrolyzerRecipes_GT = new GT_Recipe_Map_LargeNEI( - new HashSet<>(2000), - "gtpp.recipe.multielectro", - "Multiblock Electrolyzer", - null, - "", - 6, - 6, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT).setUsualFluidInputCount(6) - .setUsualFluidOutputCount(6); - - public static final GT_Recipe_Map sMultiblockMixerRecipes_GT = new GT_Recipe_Map_LargeNEI( - new HashSet<>(2000), - "gtpp.recipe.multimixer", - "Multiblock Mixer", - null, - "", - 9, - 9, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setProgressBar(GT_UITextures.PROGRESSBAR_MIXER, ProgressBar.Direction.CIRCULAR_CW) - .setUsualFluidInputCount(6).setUsualFluidOutputCount(6); - - public static final GT_Recipe_Map sMultiblockChemicalDehydratorRecipes = new GT_Recipe_Map_LargeNEI( - new HashSet<>(2000), - "gtpp.recipe.multidehydrator", - "Multiblock Dehydrator", - null, - "", - 6, - 9, - 0, - 0, - 1, - "", - 0, - "", - false, - true).setUsualFluidInputCount(3).setUsualFluidOutputCount(3); - - // Semi-Fluid Fuel Map - public static final GT_Recipe_Map_Fuel sSemiFluidLiquidFuels = (GT_Recipe_Map_Fuel) new GT_Recipe_Map_Fuel( - new HashSet<>(10), - "gtpp.recipe.semifluidgeneratorfuels", - "Semifluid Generator Fuels", - null, - "", - 0, - 0, - 0, - 0, - 1, - "Fuel Value: ", - 1000, - " EU", - true, - true).useModularUI(true); - - // Flotation Cell - public static final GT_Recipe_Map sFlotationCellRecipes = new GT_Recipe_Map( - new HashSet<>(10000), - "gtpp.recipe.flotationcell", - "Flotation Cell", - null, - "", - 6, - 0, - 1, - 1, - 1, - "", - 1, - E, - true, - true).useModularUI(true); - - // Tree Growth Simulator - public static final GT_Recipe_Map sTreeSimFakeRecipes = new GT_Recipe_Map( - new HashSet<>(100), - "gtpp.recipe.treefarm", - "Tree Growth Simulator", - null, - "", - 1, - 2, - 1, - 0, - 1, - "", - 1, - "", - false, - true) { - - @Override - protected void drawNEIEnergyInfo(NEIRecipeInfo recipeInfo) {} - - @Override - protected void drawNEIDurationInfo(NEIRecipeInfo recipeInfo) {} - - @Override - protected List handleNEIItemOutputTooltip(List currentTip, FixedPositionedStack pStack) { - if (ModItems.fluidFertBasic != null && pStack.isChanceBased()) { - // noinspection deprecation - currentTip - .add(GRAY + "Outputted if " + ModItems.fluidFertBasic.getLocalizedName() + " is provided"); - } else { - super.handleNEIItemOutputTooltip(currentTip, pStack); - } - return currentTip; - } - - @Override - protected void drawNEIOverlayForOutput(FixedPositionedStack stack) {} - }.useModularUI(true).setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - List result = new ArrayList<>(); - if (ModItems.fluidFertBasic != null) { - result.add("The sapling is not consumed."); - // noinspection deprecation - result.add("If " + ModItems.fluidFertBasic.getLocalizedName() + " is provided,"); - result.add("Saplings are made instead"); - } - return result; - }); - } - - public static class GTPP_Recipe_Map_ChemicalPlant extends GT_Recipe_Map { - - private static final List tierMaterialNames = Arrays.asList( - "Bronze", - "Steel", - "Aluminium", - "Stainless Steel", - "Titanium", - "Tungsten Steel", - "Laurenium", - "Botmium"); - - public GTPP_Recipe_Map_ChemicalPlant(Collection aRecipeList, String aUnlocalizedName, - String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, - int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, - int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, - boolean aNEIAllowed) { - super( - aRecipeList, - aUnlocalizedName, - aLocalName, - aNEIName, - aNEIGUIPath, - aUsualInputCount, - aUsualOutputCount, - aMinimalInputItems, - aMinimalInputFluids, - aAmperage, - aNEISpecialValuePre, - aNEISpecialValueMultiplier, - aNEISpecialValuePost, - aShowVoltageAmperageInNEI, - aNEIAllowed); - setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_1); - setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_VIAL_1); - setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_MOLECULAR_3); - setSlotOverlay(true, true, GT_UITextures.OVERLAY_SLOT_VIAL_2); - setProgressBar(GTPP_UITextures.PROGRESSBAR_FLUID_REACTOR, ProgressBar.Direction.CIRCULAR_CW); - setProgressBarPos(82, 24); - setUsualFluidInputCount(4); - setUsualFluidOutputCount(2); - setNEISpecialInfoFormatter((recipeInfo, applyPrefixAndSuffix) -> { - int specialValue = recipeInfo.recipe.mSpecialValue; - String tierMaterial = ""; - for (int i = 0; i < tierMaterialNames.size(); i++) { - if (i == specialValue) { - tierMaterial = tierMaterialNames.get(i); - } - } - // blockrenderer uses 1-indexed - return Collections.singletonList(applyPrefixAndSuffix.apply(specialValue + 1) + " - " + tierMaterial); - }); - } - - @Override - public List getItemInputPositions(int itemInputCount) { - return UIHelper.getGridPositions(itemInputCount, 7, 6, itemInputCount, 1); - } - - @Override - public List getItemOutputPositions(int itemOutputCount) { - return UIHelper.getGridPositions(itemOutputCount, 106, 15, 2); - } - - @Override - public List getFluidInputPositions(int fluidInputCount) { - return UIHelper.getGridPositions(fluidInputCount, 7, 41, fluidInputCount, 1); - } - - @Override - public List getFluidOutputPositions(int fluidOutputCount) { - return UIHelper.getGridPositions(fluidOutputCount, 142, 15, 1, fluidOutputCount); - } - - @Override - protected List handleNEIItemInputTooltip(List currentTip, 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(FixedPositionedStack stack) { - if (ItemUtils.isCatalyst(stack.item)) { - drawNEIOverlayText("NC*", stack); - } else { - super.drawNEIOverlayForInput(stack); - } - } - } -} diff --git a/src/main/java/gregtech/api/util/HotFuel.java b/src/main/java/gregtech/api/util/HotFuel.java index b8fcef1308..15104807a4 100644 --- a/src/main/java/gregtech/api/util/HotFuel.java +++ b/src/main/java/gregtech/api/util/HotFuel.java @@ -3,11 +3,13 @@ package gregtech.api.util; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import gtPlusPlus.api.recipe.GTPPRecipeMaps; + public class HotFuel { public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, ItemStack[] outputItems, int[] chances, int aSpecialValue) { - GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe( + GTPPRecipeMaps.thermalBoilerRecipes.addRecipe( true, null, outputItems, @@ -22,7 +24,7 @@ public class HotFuel { } public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) { - GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe( + GTPPRecipeMaps.thermalBoilerRecipes.addRecipe( false, null, null, diff --git a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java index c808a892dc..be4dc21815 100644 --- a/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java +++ b/src/main/java/gregtech/api/util/SemiFluidFuelHandler.java @@ -1,6 +1,6 @@ package gregtech.api.util; -import static gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map.sSemiFluidLiquidFuels; +import static gtPlusPlus.api.recipe.GTPPRecipeMaps.semiFluidFuels; import java.util.HashMap; @@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.recipe.RecipeMaps; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -27,7 +28,7 @@ public class SemiFluidFuelHandler { public static boolean addSemiFluidFuel(FluidStack aFuel, int aFuelValue) { FluidStack p = aFuel; if (p != null && aFuelValue > 0) { - GT_Recipe aRecipe = new GTPP_Recipe( + GT_Recipe aRecipe = new GT_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -44,7 +45,7 @@ public class SemiFluidFuelHandler { + " to the Semi-Fluid Generator fuel map. Fuel Produces " + (aRecipe.mSpecialValue * 1000) + "EU per 1000L."); - sSemiFluidLiquidFuels.add(aRecipe); + semiFluidFuels.add(aRecipe); return true; } } else { @@ -59,7 +60,7 @@ public class SemiFluidFuelHandler { final FluidStack aHeavyOil = FluidUtils.getFluidStack("liquid_heavy_oil", 1000); final HashMap> aFoundFluidsFromItems = new HashMap<>(); // Find Fluids From items - for (final GT_Recipe r : gregtech.api.util.GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels.mRecipeList) { + for (final GT_Recipe r : RecipeMaps.denseLiquidFuels.getAllRecipes()) { GT_Recipe g = r.copy(); @@ -84,7 +85,7 @@ public class SemiFluidFuelHandler { + " to the Semi-Fluid Generator fuel map. Fuel Produces " + g.mSpecialValue + "EU per 1000L."); - sSemiFluidLiquidFuels.add(g); + semiFluidFuels.add(g); } } for (Pair p : aFoundFluidsFromItems.values()) { @@ -99,7 +100,7 @@ public class SemiFluidFuelHandler { } if (aFuelValue <= (128 * 3)) { - GT_Recipe aRecipe = new GTPP_Recipe( + GT_Recipe aRecipe = new GT_Recipe( true, new ItemStack[] {}, new ItemStack[] {}, @@ -116,13 +117,13 @@ public class SemiFluidFuelHandler { + " to the Semi-Fluid Generator fuel map. Fuel Produces " + (aRecipe.mSpecialValue * 1000) + "EU per 1000L."); - sSemiFluidLiquidFuels.add(aRecipe); + semiFluidFuels.add(aRecipe); } } else { Logger.INFO("Boosted Fuel value for " + p.getKey().getLocalizedName() + " exceeds 512k, ignoring."); } } } - return sSemiFluidLiquidFuels.mRecipeList.size() > 0; + return !semiFluidFuels.getAllRecipes().isEmpty(); } } diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index b9a1ce86b8..69078ee499 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -28,11 +28,11 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Materials; +import gregtech.api.recipe.RecipeMaps; import gregtech.api.util.FishPondFakeRecipe; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GT_Recipe; import gregtech.api.util.SemiFluidFuelHandler; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.commands.CommandEnableDebugWhileRunning; import gtPlusPlus.core.commands.CommandMath; import gtPlusPlus.core.common.CommonProxy; @@ -44,7 +44,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.LocaleUtils; -import gtPlusPlus.nei.NEI_IMC_Sender; import gtPlusPlus.plugin.manager.Core_Manager; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -175,7 +174,6 @@ public class GTplusplus implements ActionListener { proxy.registerNetworkStuff(); Meta_GT_Proxy.init(); Core_Manager.init(); - NEI_IMC_Sender.IMCSender(); // Used by foreign players to generate .lang files for translation. if (CORE.ConfigSwitches.dumpItemAndBlockData) { LocaleUtils.generateFakeLocaleFile(); @@ -259,27 +257,24 @@ public class GTplusplus implements ActionListener { FishPondFakeRecipe.generateFishPondRecipes(); SemiFluidFuelHandler.generateFuels(); - mInvalidCount[0] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT); + mInvalidCount[0] = RecipeGen_MultisUsingFluidInsteadOfCells + .generateRecipesNotUsingCells(RecipeMaps.centrifugeRecipes, GTPPRecipeMaps.centrifugeNonCellRecipes); mInvalidCount[1] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); - mInvalidCount[2] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GT_Recipe.GT_Recipe_Map.sVacuumRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT); - mInvalidCount[3] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GT_Recipe.GT_Recipe_Map.sMixerRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT); + RecipeMaps.electrolyzerRecipes, + GTPPRecipeMaps.electrolyzerNonCellRecipes); + mInvalidCount[2] = RecipeGen_MultisUsingFluidInsteadOfCells + .generateRecipesNotUsingCells(RecipeMaps.vacuumFreezerRecipes, GTPPRecipeMaps.advancedFreezerRecipes); + mInvalidCount[3] = RecipeGen_MultisUsingFluidInsteadOfCells + .generateRecipesNotUsingCells(RecipeMaps.mixerRecipes, GTPPRecipeMaps.mixerNonCellRecipes); mInvalidCount[4] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sMultiblockChemicalDehydratorRecipes); + GTPPRecipeMaps.chemicalDehydratorRecipes, + GTPPRecipeMaps.chemicalDehydratorNonCellRecipes); mInvalidCount[5] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GTPP_Recipe.GTPP_Recipe_Map.sColdTrapRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sNuclearSaltProcessingPlantRecipes); + GTPPRecipeMaps.coldTrapRecipes, + GTPPRecipeMaps.nuclearSaltProcessingPlantRecipes); mInvalidCount[6] = RecipeGen_MultisUsingFluidInsteadOfCells.generateRecipesNotUsingCells( - GTPP_Recipe.GTPP_Recipe_Map.sReactorProcessingUnitRecipes, - GTPP_Recipe.GTPP_Recipe_Map.sNuclearSaltProcessingPlantRecipes); + GTPPRecipeMaps.reactorProcessingUnitRecipes, + GTPPRecipeMaps.nuclearSaltProcessingPlantRecipes); } private static void setupMaterialBlacklist() { 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..42d1fb9f50 --- /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 getItemInputPositions(int itemInputCount) { + return UIHelper.getGridPositions(itemInputCount, 7, 6, itemInputCount, 1); + } + + @Override + public List getItemOutputPositions(int itemOutputCount) { + return UIHelper.getGridPositions(itemOutputCount, 106, 15, 2); + } + + @Override + public List getFluidInputPositions(int fluidInputCount) { + return UIHelper.getGridPositions(fluidInputCount, 7, 41, fluidInputCount, 1); + } + + @Override + public List getFluidOutputPositions(int fluidOutputCount) { + return UIHelper.getGridPositions(fluidOutputCount, 142, 15, 1, fluidOutputCount); + } + + @Override + protected List handleNEIItemInputTooltip(List 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..2d1aff7add --- /dev/null +++ b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeCategories.java @@ -0,0 +1,19 @@ +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..9d02865c5b --- /dev/null +++ b/src/main/java/gtPlusPlus/api/recipe/GTPPRecipeMaps.java @@ -0,0 +1,157 @@ +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; + +public class GTPPRecipeMaps { + + public static final RecipeMap 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 multiblockMassFabricatorRecipes = RecipeMapBuilder + .of("gtpp.recipe.matterfab2").maxIO(2, 0, 1, 1).build(); + public static final RecipeMap 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 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 chemicalDehydratorRecipes = RecipeMapBuilder + .of("gtpp.recipe.chemicaldehydrator").maxIO(2, 9, 1, 1) + .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN).build(); + public static final RecipeMap 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 alloyBlastSmelterRecipes = RecipeMapBuilder + .of("gtpp.recipe.alloyblastsmelter").maxIO(9, 9, 3, 3).minInputs(1, 0).frontend(LargeNEIFrontend::new) + .build(); + public static final RecipeMap 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 nuclearSaltProcessingPlantRecipes = RecipeMapBuilder + .of("gtpp.recipe.nuclearsaltprocessingplant").maxIO(1, 6, 2, 3).frontend(LargeNEIFrontend::new).build(); + public static final RecipeMap millingRecipes = RecipeMapBuilder.of("gtpp.recipe.oremill") + .maxIO(3, 1, 0, 0).minInputs(1, 0).frontend(MillingFrontend::new).build(); + public static final RecipeMap fissionFuelProcessingRecipes = RecipeMapBuilder + .of("gtpp.recipe.fissionfuel").maxIO(0, 0, 6, 1).frontend(FluidOnlyFrontend::new).build(); + public static final RecipeMap coldTrapRecipes = RecipeMapBuilder.of("gtpp.recipe.coldtrap") + .maxIO(2, 9, 1, 1).progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN).build(); + public static final RecipeMap reactorProcessingUnitRecipes = RecipeMapBuilder + .of("gtpp.recipe.reactorprocessingunit").maxIO(2, 9, 1, 1) + .progressBar(GT_UITextures.PROGRESSBAR_SIFT, ProgressBar.Direction.DOWN).build(); + public static final RecipeMap 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 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 chemicalPlantRecipes = RecipeMapBuilder + .of("gtpp.recipe.fluidchemicaleactor").maxIO(4, 4, 4, 2) + .slotOverlays((index, isFluid, isOutput, isSpec