From 6cc4a93aad80d3402a18d29e10cf3a65dfa2f836 Mon Sep 17 00:00:00 2001 From: LlamaLad7 Date: Mon, 20 Mar 2023 23:19:39 +0000 Subject: [PATCH 1/2] Build: Bump versions. We need ASM >=9 for this PR. The other stuff just seems to have broken over time. --- build.gradle | 8 ++++---- example/resources/fabric.mod.json | 2 +- gradle/wrapper/gradle-wrapper.properties | 6 ++++++ resources/fabric.mod.json | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 gradle/wrapper/gradle-wrapper.properties diff --git a/build.gradle b/build.gradle index b9b7d96..4a2df3f 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { } } dependencies { - classpath 'com.github.Chocohead:fabric-loom:415c6b' + classpath 'com.github.Chocohead:fabric-loom:49aa217' } } @@ -34,9 +34,9 @@ minecraft { } dependencies { - minecraft "com.mojang:minecraft:1.14 Pre-Release 3" - mappings "net.fabricmc:yarn:1.14 Pre-Release 3+build.1:tiny@gz" - modCompile "net.fabricmc:fabric-loader:0.7.0+build.171" + minecraft "com.mojang:minecraft:1.14" + mappings "net.fabricmc:yarn:1.14+build.1:tiny@gz" + modCompile "net.fabricmc:fabric-loader:0.10.0+build.208" } sourceSets { diff --git a/example/resources/fabric.mod.json b/example/resources/fabric.mod.json index 4b38d1a..44f73e8 100644 --- a/example/resources/fabric.mod.json +++ b/example/resources/fabric.mod.json @@ -22,7 +22,7 @@ ] }, "depends": { - "fabricloader": ">=0.7.0", + "fabricloader": ">=0.10.0", "mm": ">=2.3" } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..9cc621c --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/resources/fabric.mod.json b/resources/fabric.mod.json index 2fa5a5d..11b1956 100644 --- a/resources/fabric.mod.json +++ b/resources/fabric.mod.json @@ -21,7 +21,7 @@ ] }, "depends": { - "fabricloader": ">=0.7.0" + "fabricloader": ">=0.10.0" }, "mixins": [{ "config": "mixins.mm.json" From 11edbe4c4f336321cfc8ee7975018c7ff6294844 Mon Sep 17 00:00:00 2001 From: LlamaLad7 Date: Mon, 20 Mar 2023 23:20:28 +0000 Subject: [PATCH 2/2] EnumExtender: Support sealed classes. --- src/com/chocohead/mm/EnumExtender.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/chocohead/mm/EnumExtender.java b/src/com/chocohead/mm/EnumExtender.java index 783af93..d014625 100644 --- a/src/com/chocohead/mm/EnumExtender.java +++ b/src/com/chocohead/mm/EnumExtender.java @@ -176,6 +176,10 @@ static Consumer makeEnumExtender(EnumAdder builder) { InsnList arrayFilling = new InsnList(); for (EnumAddition addition : builder.getAdditions()) { + String additionType = addition.isEnumSubclass() ? anonymousClassFactory.get() : node.name; + if (addition.isEnumSubclass() && node.permittedSubclasses != null) { + node.permittedSubclasses.add(additionType); + } node.visitField(Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_STATIC + Opcodes.ACC_ENUM, addition.name, 'L' + node.name + ';', null, null); LabelNode stuffStart; @@ -193,7 +197,6 @@ static Consumer makeEnumExtender(EnumAdder builder) { fieldSetting.add(stuffStart); } else stuffStart = null; - String additionType = addition.isEnumSubclass() ? anonymousClassFactory.get() : node.name; fieldSetting.add(new TypeInsnNode(Opcodes.NEW, additionType)); fieldSetting.add(new InsnNode(Opcodes.DUP));