Port to 1.21

- Rewrite packet system to use vanilla payloads
- Water bottles will now appear slightly transparent
- One of the hardest 1.21 ports yet
This commit is contained in:
Martin Prokoph
2024-06-18 19:06:41 +02:00
parent f1d4e36ed9
commit cd9db8c8bc
43 changed files with 529 additions and 425 deletions

View File

@@ -1,59 +1,67 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id 'com.github.johnrengelman.shadow'
id "me.shedaniel.unified-publishing"
}
repositories {
maven { url "https://api.modrinth.com/maven" }
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
}
architectury {
injectInjectables = false
platformSetupLoomIde()
neoForge()
}
loom {}
repositories {
maven { url "https://api.modrinth.com/maven" }
maven {url "https://maven.neoforged.net/releases"}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
common {
canBeResolved = true
canBeConsumed = false
}
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentForge.extendsFrom common
developmentNeoForge.extendsFrom common
// Files in this configuration will be bundled into your mod using the Shadow plugin.
// Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files.
shadowBundle {
canBeResolved = true
canBeConsumed = false
}
archivesBaseName = rootProject.archives_base_name + "-neoforge"
}
dependencies {
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury-neoforge:${rootProject.architectury_version}"
modImplementation "maven.modrinth:midnightlib:1.5.2-neoforge"
//include "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-forge"
neoForge "net.neoforged:neoforge:$rootProject.neoforge_version"
modImplementation "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-neoforge"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge')
}
processResources {
inputs.property "version", project.version
inputs.property 'version', project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version
filesMatching('META-INF/neoforge.mods.toml') {
expand version: project.version
}
}
shadowJar {
exclude "fabric.mod.json"
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
configurations = [project.configurations.shadowBundle]
archiveClassifier = 'dev-shadow'
}
remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
}
sourcesJar {
@@ -91,7 +99,7 @@ unifiedPublishing {
curseforge {
token = CURSEFORGE_TOKEN
id = rootProject.curseforge_id
gameVersions.addAll "Java 17", project.minecraft_version
gameVersions.addAll "Java 21", project.minecraft_version
releaseType = "alpha"
}
}