From a747e37665c0b977b23d331e7e0d2df41642cef3 Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Sat, 11 Jan 2025 03:21:05 +0800 Subject: [PATCH 1/2] remove turbine cutoff --- .../gtPlusPlus/core/config/Configuration.java | 9 --- .../core/handler/CompatIntermodStaging.java | 1 - .../gtPlusPlus/recipes/RecipeRemovals.java | 76 ------------------- 3 files changed, 86 deletions(-) diff --git a/src/main/java/gtPlusPlus/core/config/Configuration.java b/src/main/java/gtPlusPlus/core/config/Configuration.java index 45ba7df8a3b..d19d04cbf38 100644 --- a/src/main/java/gtPlusPlus/core/config/Configuration.java +++ b/src/main/java/gtPlusPlus/core/config/Configuration.java @@ -12,7 +12,6 @@ public class Configuration { public static final Debug debug = new Debug(); public static final Machines machines = new Machines(); - public static final Gregtech gregtech = new Gregtech(); public static final Features features = new Features(); public static final Visual visual = new Visual(); public static final Worldgen worldgen = new Worldgen(); @@ -49,14 +48,6 @@ public static class Machines { public int boilerSteamPerSecond; } - @Config.Comment("GregTech section") - public static class Gregtech { - - @Config.Comment("Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable.") - @Config.DefaultInt(25_500) - public int turbineCutoffBase; - } - @Config.Comment("Features section") public static class Features { diff --git a/src/main/java/gtPlusPlus/core/handler/CompatIntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/CompatIntermodStaging.java index 7d08318c551..47626fd0747 100644 --- a/src/main/java/gtPlusPlus/core/handler/CompatIntermodStaging.java +++ b/src/main/java/gtPlusPlus/core/handler/CompatIntermodStaging.java @@ -45,6 +45,5 @@ public static void postInit(FMLPostInitializationEvent postinit) { public static void onLoadComplete(FMLLoadCompleteEvent event) { HandlerGT.onLoadComplete(event); - RecipeRemovals.onLoadComplete(); } } diff --git a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java index 1a5ea35070f..51580d780d1 100644 --- a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java +++ b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java @@ -28,80 +28,4 @@ public static void postInit() { RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer)); } } - - public static void onLoadComplete() { - removeCrudeTurbineRotors(); - } - - // Doesn't actually remove recipes, just hide them - private static void removeCrudeTurbineRotors() { - int aRemoved = 0; - int CUT = Configuration.gregtech.turbineCutoffBase; - Item aU; - Collection aAssRecipes = RecipeMaps.assemblerRecipes.getAllRecipes(); - // 170, 172, 174, 176 - if (!aAssRecipes.isEmpty()) { - for (GTRecipe 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 MetaGeneratedTool01) { - int aMeta = aI.getItemDamage(); - // Found a Turbine - if (aMeta >= 170 && aMeta <= 176) { - int aCutoff; - String aType; - switch (aMeta) { - case 170 -> { - aCutoff = CUT; - aType = "Small "; - } - case 172 -> { - aCutoff = 2 * CUT; - aType = ""; - } - case 174 -> { - aCutoff = 3 * CUT; - aType = "Large "; - } - default -> { // 176 - aCutoff = 4 * CUT; - aType = "Huge "; - } - } - Materials aMainMaterial = MetaGeneratedTool.getPrimaryMaterial(aI); - Materials aSecondaryMaterial = MetaGeneratedTool.getSecondaryMaterial(aI); - long rotorDurabilityMax = MetaGeneratedTool.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."); - } } From 2b5e35cd2b15fd8e07a164f7836b1f0b28a8a989 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:19:06 -0600 Subject: [PATCH 2/2] spotless because our action is broken rn --- .../java/gtPlusPlus/recipes/RecipeRemovals.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java index 51580d780d1..cb66bb2ed8f 100644 --- a/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java +++ b/src/main/java/gtPlusPlus/recipes/RecipeRemovals.java @@ -1,23 +1,7 @@ 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 org.apache.commons.lang3.ArrayUtils; - import advsolar.common.AdvancedSolarPanel; -import gregtech.api.enums.Materials; import gregtech.api.enums.Mods; -import gregtech.api.items.MetaGeneratedTool; -import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GTRecipe; -import gregtech.common.items.MetaGeneratedTool01; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils;