Skip to content

Commit

Permalink
zeta class shouldnt be getting loaded during mixin apply whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Feb 1, 2024
1 parent 42dc3c1 commit 425a69c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.violetmoon.zeta.api;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.ApiStatus;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AnnotationNode;
Expand All @@ -19,6 +21,8 @@
*/
@ApiStatus.Internal
public class ConditionalMixinManager {
private static final Logger LOGGER = LogManager.getLogger("ZetaConditionalMixinManager");

public static boolean shouldApply(Zeta zeta, String targetClassName, String mixinClassName) {
try {
List<AnnotationNode> annotationNodes = MixinService.getService().getBytecodeProvider().getClassNode(targetClassName).visibleAnnotations;
Expand All @@ -31,7 +35,7 @@ public static boolean shouldApply(Zeta zeta, String targetClassName, String mixi
boolean applyIfPresent = Annotations.getValue(node, "applyIfPresent", Boolean.TRUE);
boolean anyModsLoaded = areModsLoaded(zeta, mods);
shouldApply = anyModsLoaded == applyIfPresent;
Zeta.GLOBAL_LOG.info("{}: {} is{}being applied because the mod(s) {} are{}loaded", zeta.getModDisplayName(zeta.modid), targetClassName, shouldApply ? " " : " not ", mods, anyModsLoaded ? " " : " not ");
LOGGER.info("{}: {} is{}being applied because the mod(s) {} are{}loaded", zeta.getModDisplayName(zeta.modid), targetClassName, shouldApply ? " " : " not ", mods, anyModsLoaded ? " " : " not ");
}
}

Expand Down

0 comments on commit 425a69c

Please sign in to comment.