From f98a1f5d53792c026c3688fa89dea3e69910cb3a Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 8 Jun 2023 00:11:46 +0200 Subject: Update to 1.20 - Remove some devenv mods that are not updated yet - Replace lib39 with fletchingtable for automixins - Use non kotlin entrypoints - Make use of DrawContext in a bunch of places --- .../java/moe/nea/firmament/init/MixinPlugin.java | 38 ++++++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'src/main/java/moe/nea/firmament/init') 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 myTargets, Set otherTargets) { + } @Override public List 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) { + } } -- cgit