From 43f02e249f677695c0915cfb27d917b2c1752edc Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 26 Dec 2023 19:45:12 +0100 Subject: [PATCH] Port to 1.20.4 --- .../{build_2002.yml => build_2004.yml} | 4 +- .kubejs/meta.json | 6 +-- build.gradle | 4 +- common/build.gradle | 2 +- forge/build.gradle | 37 ++++++++++++------- forge/gradle.properties | 2 +- forge/src/main/resources/META-INF/mods.toml | 15 +++++--- gradle.properties | 11 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 9 files changed, 46 insertions(+), 37 deletions(-) rename .github/workflows/{build_2002.yml => build_2004.yml} (97%) diff --git a/.github/workflows/build_2002.yml b/.github/workflows/build_2004.yml similarity index 97% rename from .github/workflows/build_2002.yml rename to .github/workflows/build_2004.yml index 5f4999ed..c6f7d1a7 100644 --- a/.github/workflows/build_2002.yml +++ b/.github/workflows/build_2004.yml @@ -3,8 +3,8 @@ name: Java CI on: push: branches: - - "1.20/dev" - - "1.20/main" + - "1.20.4/dev" + - "1.20.4/main" workflow_dispatch: inputs: norelease: diff --git a/.kubejs/meta.json b/.kubejs/meta.json index b94379db..11febc11 100644 --- a/.kubejs/meta.json +++ b/.kubejs/meta.json @@ -1,5 +1,5 @@ { - "minecraft": 2001, + "minecraft": 2004, "type": "architectury", "version": { "file": "gradle.properties", @@ -9,8 +9,8 @@ }, "downloads": [ { - "name": "Forge", - "url": "https://maven.saps.dev/releases/dev/latvian/mods/rhino-forge/{version}/rhino-forge-{version}.jar" + "name": "NeoForge", + "url": "https://maven.saps.dev/releases/dev/latvian/mods/rhino-neoforge/{version}/rhino-neoforge-{version}.jar" }, { "name": "Fabric", diff --git a/build.gradle b/build.gradle index 832ef9c7..1f1554af 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,7 @@ import java.time.Instant plugins { id 'base' id 'architectury-plugin' version '3.4-SNAPSHOT' - id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false - id "io.github.juuxel.loom-vineflower" version "1.11.0" apply false + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false id "com.github.johnrengelman.shadow" version "7.0.0" apply false id "me.shedaniel.unified-publishing" version "0.1.+" apply false } @@ -34,7 +33,6 @@ subprojects { apply plugin: "java" apply plugin: "dev.architectury.loom" apply plugin: 'architectury-plugin' - apply plugin: "io.github.juuxel.loom-vineflower" apply plugin: "maven-publish" apply from: "https://files.latmod.com/public/markdown-git-changelog.gradle" diff --git a/common/build.gradle b/common/build.gradle index 630229f5..2b1205bb 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,7 +3,7 @@ dependencies { } architectury { - common("forge", "fabric") + common("neoforge", "fabric") } loom { diff --git a/forge/build.gradle b/forge/build.gradle index 71f9b9a6..31965127 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -4,34 +4,39 @@ plugins { architectury { platformSetupLoomIde() - forge() + neoForge { + platformPackage = "forge" + } } configurations { - developmentForge.extendsFrom common + developmentNeoForge.extendsFrom common } loom { accessWidenerPath = project(":common").file("src/main/resources/rhino.accesswidener") - forge { - convertAccessWideners = true - extraAccessWideners.add("rhino.accesswidener") - mixinConfigs = [ - "rhino-common.mixins.json" - ] + + interfaceInjection { + interfaceInjectionSourceSets.add project(':common').sourceSets.main + } +} + +repositories { + maven { + url "https://maven.neoforged.net/releases" } } dependencies { - forge("net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}") + neoForge("net.neoforged:neoforge:${rootProject.forge_version}") common(project(path: ":common", configuration: "namedElements")) { transitive false } - bundle(project(path: ":common", configuration: "transformProductionForge")) { transitive false } + bundle(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive false } } processResources { def toReplace = [ - "version" : project.version + "version": project.version ] inputs.properties toReplace @@ -54,6 +59,10 @@ jar { } } +remapJar { + atAccessWideners.add "kubejs.accesswidener" +} + components.java { withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { skip() @@ -64,8 +73,8 @@ unifiedPublishing { project { releaseType = rootProject.artifact_type gameVersions = Arrays.asList(rootProject.supported_versions.split(',')) - gameLoaders = ["forge"] - displayName = "$mod_name Forge $project.version" + gameLoaders = ["neoforge"] + displayName = "$mod_name NeoForge $project.version" changelog = getGitChangelog() mainPublication remapJar @@ -89,7 +98,7 @@ unifiedPublishing { publishing { publications { mavenForge(MavenPublication) { - artifactId = "${rootProject.archives_base_name}-${project.name}" + artifactId = "${rootProject.archives_base_name}-neoforge" from components.java } } diff --git a/forge/gradle.properties b/forge/gradle.properties index 32f842a6..2914393d 100644 --- a/forge/gradle.properties +++ b/forge/gradle.properties @@ -1 +1 @@ -loom.platform=forge \ No newline at end of file +loom.platform=neoforge \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index bd1b1696..65f25076 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader = "javafml" -loaderVersion = "[38,)" +loaderVersion = "[2,)" issueTrackerURL = "https://github.com/KubeJS-Mods/Rhino/issues" license = "MPL-2.0" @@ -13,15 +13,18 @@ A fork of Mozilla's Rhino library, modified for use in mods ''' [[dependencies.rhino]] -modId = "forge" -mandatory = true -versionRange = "[38.0.0,)" +modId = "neoforge" +type = "required" +versionRange = "[20.4.60-beta,)" ordering = "NONE" side = "BOTH" [[dependencies.rhino]] modId = "minecraft" -mandatory = true -versionRange = "[1.18,)" +type = "required" +versionRange = "[1.20.4,)" ordering = "NONE" side = "BOTH" + +[[mixins]] +config = "rhino-common.mixins.json" diff --git a/gradle.properties b/gradle.properties index 8a3445b7..eccebd15 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,12 @@ mod_id=rhino archives_base_name=rhino mod_name=Rhino maven_group=dev.latvian.mods -mod_version=2001.2.2 +mod_version=2004.2.3 mod_author=LatvianModder curseforge_id=416294 modrinth_id=sk9knFPE artifact_type=release -minecraft_version=1.20.1 -supported_versions=1.20.1 -fabric_loader_version=0.14.22 -# DO NOT go higher than 47.1.3 due to the neoforge split -forge_version=47.1.3 \ No newline at end of file +minecraft_version=1.20.4 +supported_versions=1.20.4 +fabric_loader_version=0.15.1 +forge_version=20.4.60-beta \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 477c0eb8..004a456d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip \ No newline at end of file