diff options
author | boubou19 <miisterunknown@gmail.com> | 2023-04-09 01:08:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-09 01:08:26 +0200 |
commit | 26caa265b7eae49767947e1ff4e6cfc8166b07f5 (patch) | |
tree | 0fc0332da7a843cf153bf75fcc2e20601bbf18ee /src/main/java/gtPlusPlus/recipes | |
parent | c33b3ba66194c7441fbd437530d21a51aa4395d5 (diff) | |
download | GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.gz GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.tar.bz2 GT5-Unofficial-26caa265b7eae49767947e1ff4e6cfc8166b07f5.zip |
clean up GT++ code (#589)
* yeet big reactor support
* yeet IC2 classic support
* yeet pneumaticraft support
* yeet More Planets support
* yeet Immersive Engineering support
* yeet Psychedilicraft support
* yeet Beyond Reality Core support
* sort mods to see what must be purged
* yeet simply jetpacks
* yeet RFTools
* yeet xReliquary
* yeet RedTech
* yeet Mekanism
* yeet GrowthCraft
* yeet ihl
* leftover cleaning
* yeet thermal fondation support
* yeet compact windmills support
* spotless
* remove constants from LoadedMods (part 1 / 2)
* spotless
* remove constants from LoadedMods (part 2 / 2)
* use mod id enum instead of strings + optimize imports
* Loaded.isModLoaded -> enum
* restore RA init
* missing !
* start organizing recipes stuff
* fix crash on world load in dev
* remove unused class
* remove HazmatUtils.java
* move all the removals
* remove enableHarderRecipesForHighTierCasings and usages(disabled in the pack)
* move some pyrolyse oven recipes to its own file
* sa
* bump GT version
* bump GT5U version
* spotless apply
* use Everglades entry from the mod enum
---------
Co-authored-by: miozune <miozune@gmail.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/recipes')
-rw-r--r-- | src/main/java/gtPlusPlus/recipes/CokeAndPyrolyseOven.java | 72 | ||||
-rw-r--r-- | src/main/java/gtPlusPlus/recipes/RecipeRemovals.java | 132 |
2 files changed, 204 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/recipes/CokeAndPyrolyseOven.java b/src/main/java/gtPlusPlus/recipes/CokeAndPyrolyseOven.java new file mode 100644 index 0000000000..9aabff7a99 --- /dev/null +++ b/src/main/java/gtPlusPlus/recipes/CokeAndPyrolyseOven.java @@ -0,0 +1,72 @@ +package gtPlusPlus.recipes; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.AddGregtechRecipe; + +public class CokeAndPyrolyseOven { + + public static void onLoadComplete() { + convertPyroToCokeOven(); + } + + public static void postInit() { + Logger.INFO("Loading Recipes for Industrial Coking Oven."); + // Wood to Charcoal + // Try use all woods found + ArrayList<ItemStack> aLogData = OreDictionary.getOres("logWood"); + for (ItemStack stack : aLogData) { + AddGregtechRecipe.addCokeAndPyrolyseRecipes( + ItemUtils.getSimpleStack(stack, 20), + 20, + GT_ModHandler.getSteam(1000), + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 24L), + FluidUtils.getFluidStack("fluid.coalgas", 1440), + 60, + 30); + } + + // Coal to Coke + AddGregtechRecipe.addCokeAndPyrolyseRecipes( + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 16L), + 22, + GT_ModHandler.getSteam(1000), + ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 10), + FluidUtils.getFluidStack("fluid.coalgas", 2880), + 30, + 120); + + // Coke & Coal + CORE.RA.addCokeOvenRecipe( + GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 12L), + ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 6), + GT_ModHandler.getSteam(2000), + FluidUtils.getFluidStack("fluid.coalgas", 5040), + ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 14), + 60 * 20, + 240); + + } + + private static void convertPyroToCokeOven() { + int aCount = 0; + for (GT_Recipe g : GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.mRecipeList) { + if (AddGregtechRecipe.importPyroRecipe(g)) { + aCount++; + } + } + Logger.INFO("Converted " + aCount + " Pyrolyse recipes into Industrial Coke Oven recipes."); + } +} diff --git a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java new file mode 100644 index 0000000000..aae5f988f3 --- /dev/null +++ b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java @@ -0,0 +1,132 @@ +package gtPlusPlus.recipes; + +import static gtPlusPlus.core.util.minecraft.MaterialUtils.getMaterialName; + +import java.util.Collection; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.ArrayUtils; + +import advsolar.common.AdvancedSolarPanel; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Mods; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Recipe; +import gregtech.common.items.GT_MetaGenerated_Tool_01; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; + +public class RecipeRemovals { + + public static void postInit() { + if (Mods.AdvancedSolarPanel.isModLoaded()) { + RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer)); + } + } + + public static void onLoadComplete() { + removeCrudeTurbineRotors(); + removeGTRareEarthRecipe(); + } + + // Doesn't actually remove recipes, just hide them + private static void removeCrudeTurbineRotors() { + int aRemoved = 0; + int CUT = CORE.turbineCutoffBase; + Item aU; + Collection<GT_Recipe> aAssRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList; + // 170, 172, 174, 176 + if (aAssRecipes.size() > 0) { + for (GT_Recipe aG : aAssRecipes) { + if (ArrayUtils.isNotEmpty(aG.mOutputs)) { + for (ItemStack aI : aG.mOutputs) { + if (aI == null) { + continue; + } + aU = aI.getItem(); + if (aU == null) { + continue; + } + if (aU instanceof GT_MetaGenerated_Tool_01) { + int aMeta = aI.getItemDamage(); + // Found a Turbine + if (aMeta >= 170 && aMeta <= 176) { + int aCutoff; + String aType; + switch (aMeta) { + case 170: + aCutoff = CUT; + aType = "Small "; + break; + case 172: + aCutoff = 2 * CUT; + aType = ""; + break; + case 174: + aCutoff = 3 * CUT; + aType = "Large "; + break; + default: // 176 + aCutoff = 4 * CUT; + aType = "Huge "; + break; + } + Materials aMainMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aI); + Materials aSecondaryMaterial = GT_MetaGenerated_Tool.getSecondaryMaterial(aI); + long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI); + if (rotorDurabilityMax < aCutoff) { + Logger.WARNING( + "[Turbine Cleanup] " + getMaterialName(aMainMaterial) + + " " + + aType + + "Turbines have " + + rotorDurabilityMax + + ", which is below the cutoff durability of " + + aCutoff + + ", disabling."); + aG.mEnabled = false; + aG.mHidden = true; + aG.mCanBeBuffered = false; + aRemoved++; + } else { + break; + } + } + } + } + } + } + } + + Logger.INFO("Removed " + aRemoved + " useless Turbines."); + } + + private static void removeGTRareEarthRecipe() { + + Logger.INFO("Processing Gregtech recipe maps, removing recipes to suit GT++."); + // Remove Rare Earth Centrifuging + // 1 Rare Earth Dust - 25% chance for small piles of: neodymium, yttrium, lanthanum, cerium, cadmium, and + // caesium + // Replaced by advanced sifting recipe. + GT_Recipe aRareEarthCentrifuging = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe( + null, + false, + 20, + new FluidStack[] {}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1) }); + if (aRareEarthCentrifuging != null && aRareEarthCentrifuging.mEnabled) { + aRareEarthCentrifuging.mEnabled = false; + aRareEarthCentrifuging.mHidden = true; + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.remove(aRareEarthCentrifuging); + GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mRecipeList.remove(aRareEarthCentrifuging); + Logger.INFO("Removed vanilla GT Rare Earth processing."); + } + + } +} |