diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament/init/MixinPlugin.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/init/MixinPlugin.java | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/main/java/moe/nea/firmament/init/MixinPlugin.java b/src/main/java/moe/nea/firmament/init/MixinPlugin.java index 79a1789..663c9d9 100644 --- a/src/main/java/moe/nea/firmament/init/MixinPlugin.java +++ b/src/main/java/moe/nea/firmament/init/MixinPlugin.java @@ -18,25 +18,49 @@ package moe.nea.firmament.init; -import com.unascribed.lib39.core.api.AutoMixin; +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import java.util.List; +import java.util.Set; -// TODO: replace AutoMixin with KSP plugin? -public class MixinPlugin extends AutoMixin { +public class MixinPlugin implements IMixinConfigPlugin { + + @Override + public void onLoad(String mixinPackage) { + } + + @Override + public String getRefMapperConfig() { + return null; + } @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { if (!Boolean.getBoolean("firmament.debug") && mixinClassName.contains("devenv.")) { return false; } - return super.shouldApplyMixin(targetClassName, mixinClassName); + return true; + } + + @Override + public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { + } @Override public List<String> getMixins() { - var autoDiscoveredMixins = super.getMixins(); - autoDiscoveredMixins.removeIf(it -> !shouldApplyMixin(null, it)); - return autoDiscoveredMixins; + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } } |