diff --git a/build.gradle.kts b/build.gradle.kts index 1fc6fbd6d..86409790e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,11 +5,8 @@ plugins { minecraft { extraRunJvmArguments.add("-Dangelica.enableTestBlocks=true") extraRunJvmArguments.add("-Dangelica.dumpClass=true") -/* extraRunJvmArguments.addAll( - "-Dlegacy.debugClassLoading=true", - "-Dlegacy.debugClassLoadingFiner=true", - "-Dlegacy.debugClassLoadingSave=true")*/ - +// extraRunJvmArguments.addAll("-Dlegacy.debugClassLoadingSave=true") +// extraRunJvmArguments.addAll("-Drfb.dumpLoadedClasses=true", "-Drfb.dumpLoadedClassesPerTransformer=true") //extraRunJvmArguments.add("-Dangelica.redirectorLogspam=true") } @@ -32,9 +29,10 @@ tasks.test { } tasks.processResources { - inputs.property("version", project.version.toString()) + val projectVersion = project.version.toString() + inputs.property("version", projectVersion) filesMatching("META-INF/rfb-plugin/*") { - expand("version" to project.version.toString()) + expand("version" to projectVersion) } } diff --git a/dependencies.gradle b/dependencies.gradle index 6dc28afb1..42d885a6c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -49,16 +49,16 @@ configurations { } dependencies { - compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.14") + compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.14:dev") compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:1.0.7") { transitive = false } - compileOnly("org.projectlombok:lombok:1.18.34") { transitive = false } - annotationProcessor("org.projectlombok:lombok:1.18.34") + compileOnly("org.projectlombok:lombok:1.18.42") { transitive = false } + annotationProcessor("org.projectlombok:lombok:1.18.42") // Iris Shaders compileOnly('org.jetbrains:annotations:26.0.2') - api("com.github.GTNewHorizons:GTNHLib:0.8.21:dev") + api("com.github.GTNewHorizons:GTNHLib:0.9.0:dev") shadowImplementation("org.anarres:jcpp:1.4.14") // Apache 2.0 shadowImplementation("org.taumc:glsl-transformation-lib:0.2.0-25.g3a943bb") { exclude module: "antlr4" // we only want to shadow the runtime module @@ -66,6 +66,10 @@ dependencies { shadowImplementation("org.antlr:antlr4-runtime:4.13.2") compileOnly "org.apache.ant:ant:1.8.2" + // Celeritas (transitive=false: deps provided by GTNHLib/runtime) + shadowImplementation("org.embeddedt.celeritas:celeritas-common:2.4.0-dev") { transitive = false } + shadowImplementation("org.embeddedt.celeritas:celeritas-lwjgl2-service:2.4.0-dev") { transitive = false } + // Because who doesn't want NEI devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.35-GTNH:dev') devOnlyNonPublishable('com.github.GTNewHorizons:CodeChickenCore:1.4.7:dev') @@ -99,7 +103,7 @@ dependencies { compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684")) compileOnly(rfg.deobf("curse.maven:security-craft-64760:2818228")) - runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2")) +// runtimeOnlyNonPublishable("com.github.GTNewHorizons:CoreTweaks:0.3.3.6-GTNH") // For testing alternative splash screens, can be sourced from https://github.com/MalTeeez/ModernSplash/releases //runtimeOnly(rfg.deobf(files("dependencies/modernsplash-1.7.10-1.2.2-dev.jar"))) @@ -115,8 +119,6 @@ dependencies { testImplementation('org.junit.jupiter:junit-jupiter') testImplementation("org.mockito:mockito-core:3.+") testImplementation("org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209") - // testAnnotationProcessor("com.github.GTNewHorizons:jabel-javac-plugin:1.0.2-GTNH") // Soon :tm: - testAnnotationProcessor("com.github.bsideup.jabel:jabel-javac-plugin:1.0.1") testImplementation('org.junit.platform:junit-platform-engine') testImplementation('org.junit.platform:junit-platform-reporting') diff --git a/gradle.properties b/gradle.properties index 8dd6dd52c..2c9fe232b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,9 +39,11 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. developmentEnvironmentUserName = Developer -# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. -# See https://github.com/bsideup/jabel for details on how this works. -enableModernJavaSyntax = true +enableModernJavaSyntax = jvmDowngrader +jvmDowngraderStubsProvider = gtnhlib +jvmDowngraderMultiReleaseVersions = 17, 21, 25 + +#forceToolchainVersion = 25 # Enables injecting missing generics into the decompiled source code for a better coding experience. # Turns most publicly visible List, Map, etc. into proper List, Map types. @@ -55,23 +57,6 @@ generateGradleTokenClass = com.gtnewhorizons.angelica.Tags # Name of the token containing the project's current version to generate/replace. gradleTokenVersion = VERSION -# [DEPRECATED] Mod ID replacement token. -gradleTokenModId = - -# [DEPRECATED] Mod name replacement token. -gradleTokenModName = - -# [DEPRECATED] Mod Group replacement token. -gradleTokenGroupName = - -# [DEPRECATED] -# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java -# public static final String VERSION = "GRADLETOKEN_VERSION"; -# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's -# version in @Mod([...], version = VERSION, [...]). -# Leave these properties empty to skip individual token replacements. -replaceGradleTokenInFile = - # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. # Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api @@ -209,3 +194,7 @@ disableSpotless = true # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true +# Non-GTNH properties +org.gradle.configuration-cache = true +org.gradle.jvmargs = -Xmx2g +org.gradle.parallel = true diff --git a/repositories.gradle b/repositories.gradle index 7889ae7a6..e3c686c8a 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -15,23 +15,6 @@ repositories { includeGroup 'mega' } } - exclusiveContent { - forRepository { - ivy { - name = 'CoreTweaks releases' - url = 'https://github.com/makamys/CoreTweaks/releases/download/' - patternLayout { - artifact '[revision]/[module]-1.7.10-[revision]+nomixin(-[classifier])(.[ext])' - } - metadataSources { - artifact() - } - } - } - filter { - includeGroup('CoreTweaks') - } - } maven { name = 'taumc' url = 'https://maven.taumc.org/releases' diff --git a/settings.gradle.kts b/settings.gradle.kts index d398c6673..78dd7fdbc 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,5 +16,5 @@ pluginManagement { } plugins { - id("com.gtnewhorizons.gtnhsettingsconvention") version("2.0.6") + id("com.gtnewhorizons.gtnhsettingsconvention") version("2.0.99") } diff --git a/src/main/java/com/gtnewhorizons/angelica/AngelicaLateMixins.java b/src/main/java/com/gtnewhorizons/angelica/AngelicaLateMixins.java index ed24d021d..c3ee817bf 100644 --- a/src/main/java/com/gtnewhorizons/angelica/AngelicaLateMixins.java +++ b/src/main/java/com/gtnewhorizons/angelica/AngelicaLateMixins.java @@ -9,10 +9,14 @@ import java.util.List; import java.util.Set; @LateMixin +@SuppressWarnings("unused") public class AngelicaLateMixins implements ILateMixinLoader { @Override public String getMixinConfig() { + int v = Runtime.version().feature(); + if (v >= 21) return "mixins.angelica.late.j21.json"; + if (v >= 17) return "mixins.angelica.late.j17.json"; return "mixins.angelica.late.json"; } diff --git a/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java b/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java index 366f49988..3d6e65d1c 100644 --- a/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java +++ b/src/main/java/com/gtnewhorizons/angelica/loading/AngelicaTweaker.java @@ -45,7 +45,8 @@ import java.util.Set; @IFMLLoadingPlugin.TransformerExclusions({ "jss.notfine.asm", "com.gtnewhorizons.angelica.loading", - "com.gtnewhorizons.angelica.glsm.GLStateManager"}) + "com.gtnewhorizons.angelica.glsm.GLStateManager" +}) public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader { private static Boolean OBF_ENV; @@ -78,8 +79,19 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader { } private static void verifyDependencies() { + // Check for fastutil (bundled with GTNHLib since 0.2.1) if (AngelicaTweaker.class.getResource("/it/unimi/dsi/fastutil/ints/Int2ObjectMap.class") == null) { - throw new RuntimeException("Missing dependency: Angelica requires GTNHLib 0.2.1 or newer! Download: https://modrinth.com/mod/gtnhlib"); + throw new RuntimeException("Missing dependency: Angelica requires GTNHLib! Download: https://modrinth.com/mod/gtnhlib"); + } + + // Check for PrimitiveExtractor/cel.model classes (added in GTNHLib 0.8.21) + if (AngelicaTweaker.class.getResource("/com/gtnewhorizon/gtnhlib/client/renderer/PrimitiveExtractor.class") == null) { + throw new RuntimeException("GTNHLib is outdated: Angelica requires GTNHLib 0.8.21 or newer! Download: https://modrinth.com/mod/gtnhlib"); + } + + // Check for jvmdowngrader stubs (bundled with GTNHLib since 0.9.0) + if (AngelicaTweaker.class.getResource("/xyz/wagyourtail/jvmdg/exc/MissingStubError.class") == null) { + throw new RuntimeException("GTNHLib is outdated: Angelica requires GTNHLib 0.9.0 or newer! Download: https://modrinth.com/mod/gtnhlib"); } } @@ -140,6 +152,9 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader { @Override public String getMixinConfig() { + int v = Runtime.version().feature(); + if (v >= 21) return "mixins.angelica.early.j21.json"; + if (v >= 17) return "mixins.angelica.early.j17.json"; return "mixins.angelica.early.json"; } diff --git a/src/main/resources/mixins.angelica.early.j17.json b/src/main/resources/mixins.angelica.early.j17.json new file mode 100644 index 000000000..db14f44f6 --- /dev/null +++ b/src/main/resources/mixins.angelica.early.j17.json @@ -0,0 +1,11 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "com.gtnewhorizons.angelica.mixins.early", + "refmap": "mixins.angelica.refmap.json", + "target": "@env(DEFAULT)", + "injectors":{ + "maxShiftBy": 2 + }, + "compatibilityLevel": "JAVA_17" +} diff --git a/src/main/resources/mixins.angelica.early.j21.json b/src/main/resources/mixins.angelica.early.j21.json new file mode 100644 index 000000000..a863c304f --- /dev/null +++ b/src/main/resources/mixins.angelica.early.j21.json @@ -0,0 +1,12 @@ +{ + "required": true, + "minVersion": "0.8.7", + "package": "com.gtnewhorizons.angelica.mixins.early", + "refmap": "mixins.angelica.refmap.json", + "target": "@env(DEFAULT)", + "injectors":{ + "maxShiftBy": 2 + }, + "compatibilityLevel": "JAVA_21" +} + diff --git a/src/main/resources/mixins.angelica.late.j17.json b/src/main/resources/mixins.angelica.late.j17.json new file mode 100644 index 000000000..d957d8135 --- /dev/null +++ b/src/main/resources/mixins.angelica.late.j17.json @@ -0,0 +1,8 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "com.gtnewhorizons.angelica.mixins.late", + "refmap": "mixins.angelica.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_17" +} diff --git a/src/main/resources/mixins.angelica.late.j21.json b/src/main/resources/mixins.angelica.late.j21.json new file mode 100644 index 000000000..70f5845b9 --- /dev/null +++ b/src/main/resources/mixins.angelica.late.j21.json @@ -0,0 +1,9 @@ +{ + "required": true, + "minVersion": "0.8.3-GTNH", + "package": "com.gtnewhorizons.angelica.mixins.late", + "refmap": "mixins.angelica.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_21" +} +