Skip to content

Commit

Permalink
Port to 1.20.4
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed Dec 26, 2023
1 parent bc5f50b commit 43f02e2
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .kubejs/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"minecraft": 2001,
"minecraft": 2004,
"type": "architectury",
"version": {
"file": "gradle.properties",
Expand All @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies {
}

architectury {
common("forge", "fabric")
common("neoforge", "fabric")
}

loom {
Expand Down
37 changes: 23 additions & 14 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -54,6 +59,10 @@ jar {
}
}

remapJar {
atAccessWideners.add "kubejs.accesswidener"
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
Expand All @@ -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

Expand All @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion forge/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
loom.platform=forge
loom.platform=neoforge
15 changes: 9 additions & 6 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[38,)"
loaderVersion = "[2,)"
issueTrackerURL = "https://github.com/KubeJS-Mods/Rhino/issues"
license = "MPL-2.0"

Expand All @@ -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"
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
minecraft_version=1.20.4
supported_versions=1.20.4
fabric_loader_version=0.15.1
forge_version=20.4.60-beta
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip

0 comments on commit 43f02e2

Please sign in to comment.