From 82604eadb847335e4b4ddf2e90a28b325786837b Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Sat, 7 Sep 2024 05:40:03 +0200 Subject: Remove a bunch more reflection (#3074) Co-authored-by: boubou19 --- .../xmod/gregtech/loaders/RecipeGenFluidCanning.java | 9 +-------- .../xmod/gregtech/loaders/RecipeGenRecycling.java | 13 ++----------- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/loaders') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java index c9f627c0d5..a334fd7de4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluidCanning.java @@ -13,7 +13,6 @@ import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; public class RecipeGenFluidCanning implements Runnable { @@ -206,13 +205,7 @@ public class RecipeGenFluidCanning implements Runnable { } private void dumpStack() { - int parents = 2; - for (int i = 0; i < 6; i++) { - Logger.INFO( - (disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | " - + (i == 0 ? "Called from: " : "Parent: ") - + ReflectionUtils.getMethodName(i + parents)); - } + Logger.modLogger.info((disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG ", new Exception()); } private int getMapSize(RecipeMap aMap) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java index 8fe051dd71..305422ccea 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java @@ -28,7 +28,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; public class RecipeGenRecycling implements Runnable { @@ -252,11 +251,7 @@ public class RecipeGenRecycling implements Runnable { public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount, final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && (aAmount < 1L)) { - Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4)); + Logger.modLogger.warn("Returning Null. Method: ", new Exception()); return null; } if (!mNameMap.containsKey(aName.toString()) && aMentionPossibleTypos) { @@ -269,11 +264,7 @@ public class RecipeGenRecycling implements Runnable { public static ItemStack getFirstOre(final Object aName, final long aAmount) { if (GTUtility.isStringInvalid(aName)) { - Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(2)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(3)); - Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(4)); + Logger.modLogger.warn("Returning Null. Method: ", new Exception()); return null; } final ItemStack tStack = mNameMap.get(aName.toString()); -- cgit