diff options
author | miozune <miozune@gmail.com> | 2023-12-04 06:26:09 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 22:26:09 +0100 |
commit | b6caaf255da083516286321155ef339b60a07393 (patch) | |
tree | 89416c1d29e63de37cb43295a81913de3c24e015 /src/main/java/gregtech/api | |
parent | 4ff3ef790f4e22cc80986258f13f8a8643fda0dc (diff) | |
download | GT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.tar.gz GT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.tar.bz2 GT5-Unofficial-b6caaf255da083516286321155ef339b60a07393.zip |
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 <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/api')
6 files changed, 39 insertions, 932 deletions
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<GTPP_Recipe_Map_Internal> sMappingsEx = new ArrayList<>(); - - public GTPP_Recipe_Map_Internal(Collection<GT_Recipe> 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<String> handleNEIItemInputTooltip(List<String> 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<String> handleNEIItemOutputTooltip(List<String> 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<String> 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<String> tierMaterialNames = Arrays.asList( - "Bronze", - "Steel", - "Aluminium", - "Stainless Steel", - "Titanium", - "Tungsten Steel", - "Laurenium", - "Botmium"); - - public GTPP_Recipe_Map_ChemicalPlant(Collection<GT_Recipe> 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<Pos2d> getItemInputPositions(int itemInputCount) { - return UIHelper.getGridPositions(itemInputCount, 7, 6, itemInputCount, 1); - } - - @Override - public List<Pos2d> getItemOutputPositions(int itemOutputCount) { - return UIHelper.getGridPositions(itemOutputCount, 106, 15, 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, 15, 1, fluidOutputCount); - } - - @Override - protected List<String> handleNEIItemInputTooltip(List<String> 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<Integer, Pair<FluidStack, Integer>> 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<FluidStack, Integer> 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(); } } |