diff --git a/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java b/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java index e231938c8..7425e43c7 100644 --- a/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java +++ b/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java @@ -91,7 +91,7 @@ public String[] getASMTransformerClass() { } GenericCompatTransformer.build(); - transformers.add("com.gtnewhorizons.angelica.transform.compat.GenericCompatTransformer"); + transformers.add(GenericCompatTransformer.class.getName()); // Add NotFine transformers final List notFineTransformers = AsmTransformers.getTransformers(); diff --git a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/CompatHandlers.java b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/CompatHandlers.java index 8635c2264..c84f50a4b 100644 --- a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/CompatHandlers.java +++ b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/CompatHandlers.java @@ -15,11 +15,7 @@ public enum CompatHandlers { THAUMCRAFT(() -> CompatConfig.fixThaumcraft, new ThaumcraftCompatHandler()), THAUMIC_HORIZONS(() -> CompatConfig.fixThaumicHorizons, new ThaumicHorizonsCompatHandler()); - private static List compatHandlers = null; - private final Supplier applyIf; - - @Getter private final CompatHandler handler; CompatHandlers(Supplier applyIf, CompatHandler handler) { @@ -27,18 +23,16 @@ public enum CompatHandlers { this.handler = handler; } - public boolean shouldBeLoaded() { - return applyIf.get(); - } + private static List compatHandlers = null; public static List getHandlers() { if (compatHandlers != null) { return compatHandlers; } compatHandlers = new ArrayList<>(); - for (CompatHandlers handler : values()) { - if (handler.shouldBeLoaded()) { - compatHandlers.add(handler.getHandler()); + for (CompatHandlers value : values()) { + if (value.applyIf.get()) { + compatHandlers.add(value.handler); } } return compatHandlers; diff --git a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/ImmersiveEngineeringCompatHandler.java b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/ImmersiveEngineeringCompatHandler.java index 41365a6a2..b4db3c103 100644 --- a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/ImmersiveEngineeringCompatHandler.java +++ b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/ImmersiveEngineeringCompatHandler.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.gtnewhorizons.angelica.transform.compat.transformers.specific.ImmersiveEngineeringTransformer; import java.util.List; import java.util.Map; @@ -37,7 +38,7 @@ public Map getThreadSafeISBRHAnnotations() { @Override public List extraTransformers() { - return ImmutableList.of("com.gtnewhorizons.angelica.transform.compat.transformers.specific.ImmersiveEngineeringTransformer"); + return ImmutableList.of(ImmersiveEngineeringTransformer.class.getName()); } } diff --git a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/StacksOnStacksCompatHandler.java b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/StacksOnStacksCompatHandler.java index 9858de864..fe96055a2 100644 --- a/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/StacksOnStacksCompatHandler.java +++ b/src/main/java/com/gtnewhorizons/angelica/transform/compat/handlers/StacksOnStacksCompatHandler.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.gtnewhorizons.angelica.transform.compat.transformers.specific.StacksOnStacksTransformer; import java.util.List; import java.util.Map; @@ -27,6 +28,6 @@ public Map getThreadSafeISBRHAnnotations() { @Override public List extraTransformers() { - return ImmutableList.of("com.gtnewhorizons.angelica.transform.compat.transformers.specific.StacksOnStacksTransformer"); + return ImmutableList.of(StacksOnStacksTransformer.class.getName()); } } diff --git a/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/generic/FieldLevelTessellatorTransformer.java b/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/generic/FieldLevelTessellatorTransformer.java index e6b2231f7..d62199a2b 100644 --- a/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/generic/FieldLevelTessellatorTransformer.java +++ b/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/generic/FieldLevelTessellatorTransformer.java @@ -24,7 +24,7 @@ public static void transform(ClassNode cn, List patchMethods) { } } - public static void injectLocalTessellatorAndReplaceFieldUsage(MethodNode mn) { + private static void injectLocalTessellatorAndReplaceFieldUsage(MethodNode mn) { // This part searches the instructions to see if there is any usage of a Tessellator field // which is NOT owned by Minecraft itself. This means anyone that caches it into a field will get caught // but not direct usage of Tessellator.instance.whatever() diff --git a/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/specific/StacksOnStacksTransformer.java b/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/specific/StacksOnStacksTransformer.java index 533984d41..b3779dc59 100644 --- a/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/specific/StacksOnStacksTransformer.java +++ b/src/main/java/com/gtnewhorizons/angelica/transform/compat/transformers/specific/StacksOnStacksTransformer.java @@ -78,7 +78,7 @@ private static InsnList buildPilerRenderInitializer(String type) { return list; } - private void transformRenderTilePile(ClassNode cn) { + private static void transformRenderTilePile(ClassNode cn) { MethodNode clinit = null; for (MethodNode mn : cn.methods) { // Handles injecting field initializers for the various PileRender fields which used to be static @@ -140,7 +140,7 @@ private void transformRenderTilePile(ClassNode cn) { } } - private void transformClientUtils(ClassNode cn) { + private static void transformClientUtils(ClassNode cn) { // Various things throughout the ISBRH call these functions which in turn call GL11.glPush/PopMatrix // Upon checking, these aren't called anywhere but in the ISBRH, and they're entirely unnecessary in there. // This just makes the methods no-op, since they aren't required by any other part of the mod to be working.