diff options
77 files changed, 779 insertions, 1445 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 1d5478f..c74a424 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ plugins { alias(libs.plugins.kotlin.plugin.ksp) // alias(libs.plugins.loom) // TODO: use arch loom once they update to 1.8 - id("fabric-loom") version "1.8.9" + id("fabric-loom") version "1.9.2" alias(libs.plugins.shadow) id("moe.nea.licenseextractificator") id("moe.nea.mc-auto-translations") version "0.1.0" @@ -129,13 +129,8 @@ val collectTranslations by tasks.registering(CollectTranslations::class) { val compatSourceSets: MutableSet<SourceSet> = mutableSetOf() fun createIsolatedSourceSet(name: String, path: String = "compat/$name", isEnabled: Boolean = true): SourceSet { val ss = sourceSets.create(name) { - if (isEnabled) { - this.java.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) - this.kotlin.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) - } else { - this.java.setSrcDirs(listOf<File>()) - this.kotlin.setSrcDirs(listOf<File>()) - } + this.java.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) + this.kotlin.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) } val mainSS = sourceSets.main.get() val upperName = ss.name.capitalizeN() @@ -221,15 +216,16 @@ val testAgent by configurations.creating { val configuredSourceSet = createIsolatedSourceSet("configured", isEnabled = false) // Wait for update (also low prio, because configured sucks) -val sodiumSourceSet = createIsolatedSourceSet("sodium") +val sodiumSourceSet = createIsolatedSourceSet("sodium", isEnabled = false) val citResewnSourceSet = createIsolatedSourceSet("citresewn", isEnabled = false) // TODO: Wait for update -val yaclSourceSet = createIsolatedSourceSet("yacl") +val yaclSourceSet = createIsolatedSourceSet("yacl", isEnabled = false) val explosiveEnhancementSourceSet = createIsolatedSourceSet("explosiveEnhancement", isEnabled = false) // TODO: wait for their port val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender", isEnabled = false) // TODO: wait on their port -val modmenuSourceSet = createIsolatedSourceSet("modmenu") -val reiSourceSet = createIsolatedSourceSet("rei") -val moulconfigSourceSet = createIsolatedSourceSet("moulconfig") +val modmenuSourceSet = createIsolatedSourceSet("modmenu", isEnabled = false) +val reiSourceSet = createIsolatedSourceSet("rei", isEnabled = false) +val moulconfigSourceSet = createIsolatedSourceSet("moulconfig", isEnabled = false) +val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks") dependencies { // Minecraft dependencies diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index d89c20e..54719bc 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: CC0-1.0 plugins { - kotlin("jvm") version "1.8.10" + kotlin("jvm") version "2.1.0" `kotlin-dsl` } repositories { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 74de8e8..b8ed2f1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,21 +3,23 @@ # SPDX-License-Identifier: CC0-1.0 [versions] -minecraft = "1.21.3" +minecraft = "1.21.4" # Update from https://kotlinlang.org/ -kotlin = "2.0.21" +kotlin = "2.1.0" # Update from https://github.com/google/ksp/releases -kotlin_ksp = "2.0.21-1.0.26" +kotlin_ksp = "2.1.0-1.0.29" # Update from https://linkie.shedaniel.me/dependencies?loader=fabric fabric_loader = "0.16.9" -fabric_api = "0.107.0+1.21.3" -fabric_kotlin = "1.12.3+kotlin.2.0.21" -yarn = "1.21.3+build.2" +fabric_api = "0.110.5+1.21.4" +yarn = "1.21.4+build.1" +modmenu = "13.0.0-beta.1" +architectury = "15.0.1" rei = "17.0.789" -modmenu = "12.0.0-beta.1" -architectury = "14.0.4" + +# Update from https://maven.fabricmc.net/net/fabricmc/fabric-language-kotlin/ +fabric_kotlin = "1.13.0+kotlin.2.1.0" # Update from https://maven.architectury.dev/dev/architectury/loom/dev.architectury.loom.gradle.plugin/ loom = "1.7.414" @@ -26,16 +28,16 @@ loom = "1.7.414" qolify = "1.6.0-1.21.1" # Update from https://modrinth.com/mod/sodium/versions?l=fabric -sodium = "mc1.21.3-0.6.0-beta.4-fabric" +sodium = "mc1.21.4-0.6.2-fabric" # Update from https://modrinth.com/mod/freecam/versions?l=fabric -freecammod = "vomskVK3" +freecammod = "1.3.1+mc1.21.3" # Update from https://modrinth.com/mod/no-chat-reports/versions?l=fabric ncr = "Fabric-1.21.3-v2.10.0" # Update from https://modrinth.com/mod/female-gender/versions?l=fabric -femalegender = "kJmjQvAS" +femalegender = "4.3+1.21.4" # Update from https://modrinth.com/mod/explosive-enhancement/versions?l=fabric explosiveenhancement = "1.2.3-1.21.0" @@ -49,12 +51,13 @@ citresewn = "1.2.0+1.21" devauth = "1.2.0" # Update from https://ktor.io/ -ktor = "3.0.1" +ktor = "3.0.2" # Update from https://repo.nea.moe/#/releases/moe/nea/neurepoparser neurepoparser = "1.6.0" # Update from https://github.com/HotswapProjects/HotswapAgent/releases +# TODO: bump to 2.0.1 hotswap_agent = "1.4.2-SNAPSHOT" # Update from https://github.com/LlamaLad7/MixinExtras/tags diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f861d18..6e2ced2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -4,6 +4,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/InitReplacer.java b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/InitReplacer.java index a0d28ab..7ba3b44 100644 --- a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/InitReplacer.java +++ b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/InitReplacer.java @@ -59,6 +59,14 @@ public class InitReplacer extends TreeScanner<Void, Void> { var target = plugin.utils.getAnnotationValue(jcAnnotation, "value"); var targetClass = plugin.utils.resolveClassLiteralExpression(target).tsym.flatName().toString(); var intermediaryClass = mappingTree.resolveClassToIntermediary(targetClass); + if (intermediaryClass == null){ + plugin.utils.reportError( + compilationUnitTree.getSourceFile(), + jcNode.init, + "Unknown class name " + targetClass + ); + return super.visitVariable(node, unused); + } var remapper = treeMaker.Select(treeMaker.This(classTree.type), names.fromString("remapper")); var remappingCall = treeMaker.Apply( List.nil(), diff --git a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/IntermediaryMethodReplacer.java b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/IntermediaryMethodReplacer.java index d3040b7..cb87b20 100644 --- a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/IntermediaryMethodReplacer.java +++ b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/IntermediaryMethodReplacer.java @@ -57,7 +57,12 @@ public class IntermediaryMethodReplacer extends TreeScanner<Void, Void> { } var head = node.typeargs.head; var resolved = plugin.utils.resolveClassName(head, compilationUnit); - var mappedName = mappings.resolveClassToIntermediary(resolved.tsym.flatName().toString()); + var sourceName = resolved.tsym.flatName().toString(); + var mappedName = mappings.resolveClassToIntermediary(sourceName); + if (mappedName == null) { + plugin.utils.reportError(sourceFile, node, "Unknown class name " + sourceName); + return; + } fieldAccess.name = plugin.names.fromString("id"); node.typeargs = List.nil(); node.args = List.of(plugin.treeMaker.Literal(mappedName)); diff --git a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/MappingTree.java b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/MappingTree.java index 7a270b7..eef5f9a 100644 --- a/javaplugin/src/main/java/moe/nea/firmament/javaplugin/MappingTree.java +++ b/javaplugin/src/main/java/moe/nea/firmament/javaplugin/MappingTree.java @@ -9,40 +9,43 @@ import java.util.stream.Collectors; public class MappingTree { - private final Map<String, TinyClass> classLookup; - private final int targetIndex; - private final int sourceIndex; + private final Map<String, TinyClass> classLookup; + private final int targetIndex; + private final int sourceIndex; - public MappingTree(TinyFile tinyV2File, String sourceNamespace, String targetNamespace) { - sourceIndex = tinyV2File.getHeader().getNamespaces().indexOf(sourceNamespace); - if (sourceIndex < 0) - throw new RuntimeException("Could not find source namespace " + sourceNamespace + " in mappings file."); - this.classLookup = tinyV2File - .getClassEntries() - .stream() - .collect(Collectors.toMap(it -> it.getClassNames().get(sourceIndex), it -> it)); - targetIndex = tinyV2File.getHeader().getNamespaces().indexOf(targetNamespace); - if (targetIndex < 0) - throw new RuntimeException("Could not find target namespace " + targetNamespace + " in mappings file."); - } + public MappingTree(TinyFile tinyV2File, String sourceNamespace, String targetNamespace) { + sourceIndex = tinyV2File.getHeader().getNamespaces().indexOf(sourceNamespace); + if (sourceIndex < 0) + throw new RuntimeException("Could not find source namespace " + sourceNamespace + " in mappings file."); + this.classLookup = tinyV2File + .getClassEntries() + .stream() + .collect(Collectors.toMap(it -> it.getClassNames().get(sourceIndex), it -> it)); + targetIndex = tinyV2File.getHeader().getNamespaces().indexOf(targetNamespace); + if (targetIndex < 0) + throw new RuntimeException("Could not find target namespace " + targetNamespace + " in mappings file."); + } - public String resolveMethodToInterme |
