diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
commit | 5ed74f2df49c93ed1617520a935078b59ad7e195 (patch) | |
tree | f0d52699fff7f820bd724902878988859bd43516 /src/main/java | |
parent | 816f80f862d2f5de6bc9b0ae84cd6df0da341228 (diff) | |
download | firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.gz firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.bz2 firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.zip |
Add per compat project event listeners
[no changelog]
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/moe/nea/firmament/init/MixinPlugin.java | 12 | ||||
-rw-r--r-- | src/main/java/moe/nea/firmament/init/SectionBuilderRiser.java | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/moe/nea/firmament/init/MixinPlugin.java b/src/main/java/moe/nea/firmament/init/MixinPlugin.java index e7a02b5..61e8f14 100644 --- a/src/main/java/moe/nea/firmament/init/MixinPlugin.java +++ b/src/main/java/moe/nea/firmament/init/MixinPlugin.java @@ -7,16 +7,19 @@ import org.objectweb.asm.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; +import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; public class MixinPlugin implements IMixinConfigPlugin { AutoDiscoveryPlugin autoDiscoveryPlugin = new AutoDiscoveryPlugin(); - + public static String mixinPackage; @Override public void onLoad(String mixinPackage) { MixinExtrasBootstrap.init(); + MixinPlugin.mixinPackage = mixinPackage; autoDiscoveryPlugin.setMixinPackage(mixinPackage); } @@ -40,7 +43,8 @@ public class MixinPlugin implements IMixinConfigPlugin { @Override public List<String> getMixins() { - return autoDiscoveryPlugin.getMixins(); + return autoDiscoveryPlugin.getMixins().stream().filter(it -> this.shouldApplyMixin(null, it)) + .toList(); } @Override @@ -48,8 +52,10 @@ public class MixinPlugin implements IMixinConfigPlugin { } + public static List<String> appliedMixins = new ArrayList<>(); + @Override public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - + appliedMixins.add(mixinClassName); } } diff --git a/src/main/java/moe/nea/firmament/init/SectionBuilderRiser.java b/src/main/java/moe/nea/firmament/init/SectionBuilderRiser.java index ebb060c..f2c6c53 100644 --- a/src/main/java/moe/nea/firmament/init/SectionBuilderRiser.java +++ b/src/main/java/moe/nea/firmament/init/SectionBuilderRiser.java @@ -54,7 +54,8 @@ public class SectionBuilderRiser extends RiserUtils { private void handle(ClassNode classNode) { for (MethodNode method : classNode.methods) { - if (method.name.endsWith("$fabric-renderer-indigo$hookChunkBuildTessellate") && + if ((method.name.endsWith("$fabric-renderer-indigo$hookBuildRenderBlock") + || method.name.endsWith("$fabric-renderer-indigo$hookChunkBuildTessellate")) && method.name.startsWith("redirect$")) { handleIndigo(method); return; |