feat: 环境迁移到26.1.2

This commit is contained in:
叁玖领域 2026-05-17 12:05:43 +08:00
parent 805d880ed9
commit fe3d3478a9
10 changed files with 94 additions and 160 deletions

View File

@ -1,4 +1,4 @@
plugins { plugins {
id 'fabric-loom' version '1.9-SNAPSHOT' apply false id 'net.fabricmc.fabric-loom' version '1.15.5' apply false
id 'net.neoforged.moddev' version '2.0.141' apply false id 'net.neoforged.moddev' version '2.0.141' apply false
} }

View File

@ -26,19 +26,6 @@ repositories {
} }
filter { includeGroupAndSubgroups('org.spongepowered') } filter { includeGroupAndSubgroups('org.spongepowered') }
} }
exclusiveContent {
forRepositories(
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven { url = "https://neoforged.forgecdn.net/releases" },
maven { url = "https://neoforged.forgecdn.net/mojang-meta" }
)
filter { includeGroup('org.parchmentmc.data') }
}
maven { url = "https://libraries.minecraft.net/" }
maven { maven {
url "https://cursemaven.com" url "https://cursemaven.com"
@ -48,25 +35,13 @@ repositories {
name = 'BlameJared' name = 'BlameJared'
url = 'https://maven.blamejared.com' url = 'https://maven.blamejared.com'
} }
repositories { maven {
maven { url 'https://maven.covers1624.net/' } name = 'LTDNexus'
url = 'https://nexus.bot.leisuretimedock.top/repository/maven-releases/'
} }
} maven { url 'https://maven.covers1624.net/' }
// Declare capabilities on the outgoing configurations.
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:${project.name}:$version")
capability("$group:${base.archivesName.get()}:$version")
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
capability("$group:$mod_id:$version")
}
publishing.publications.configureEach {
suppressPomMetadataWarningsFor(variant)
}
} }
sourcesJar { sourcesJar {
from(rootProject.file('LICENSE')) { from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" } rename { "${it}_${mod_name}" }
@ -112,9 +87,18 @@ processResources {
'java_version' : java_version 'java_version' : java_version
] ]
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) { var jsonExpandProps = expandProps.collectEntries {
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
}
filesMatching(['META-INF/mods.toml', 'META-INF/neoforge.mods.toml']) {
expand expandProps expand expandProps
} }
filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
expand jsonExpandProps
}
inputs.properties(expandProps) inputs.properties(expandProps)
} }
@ -137,7 +121,7 @@ publishing {
licenses { licenses {
license { license {
name = 'MIT' name = 'MIT'
url = 'https://gitea.bot.leisuretimedock.top/R3944Realms/Lib39/raw/branch/MultiLoader_1_21_1/LICENSE' url = 'https://gitea.bot.leisuretimedock.top/R3944Realms/Lib39/raw/branch/MultiLoader_26_1_2/LICENSE'
distribution = 'repo' distribution = 'repo'
} }
} }

View File

@ -13,8 +13,9 @@ configurations {
dependencies { dependencies {
compileOnly(project(':common')) { compileOnly(project(':common')) {
capabilities { def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
requireCapability "$group:$mod_id" attributes {
attribute(loaderAttribute, 'common')
} }
} }
commonJava project(path: ':common', configuration: 'commonJava') commonJava project(path: ':common', configuration: 'commonJava')
@ -36,7 +37,7 @@ tasks.named('javadoc', Javadoc).configure {
source(configurations.commonJava) source(configurations.commonJava)
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.charSet = 'UTF-8' options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/21/docs/api/") options.links("https://docs.oracle.com/en/java/javase/25/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true) options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc") options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")

View File

@ -10,22 +10,21 @@ neoForge {
if (at.exists()) { if (at.exists()) {
accessTransformers.from(at.absolutePath) accessTransformers.from(at.absolutePath)
} }
parchment {
minecraftVersion = parchment_minecraft
mappingsVersion = parchment_version
}
} }
dependencies { dependencies {
compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5' compileOnly group: 'org.spongepowered', name: 'mixin', version: '0.8.5'
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common
compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.5.3'
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.5.3'
implementation(group: 'tschipp.carryon', name: 'carryon-common-1.21.1', version: '2.2.4') { implementation(group: 'tschipp.carryon', name: 'carryon-common-26.1.2', version: '3.0.1') {
transitive = false transitive = false
} }
// fabric and neoforge both bundle mixinextras, so it is safe to use it in common // fabric and neoforge both bundle mixinextras, so it is safe to use it in common
implementation group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.4.1' compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.5.3'
annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.4.1' annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.5.3'
} }
configurations { configurations {
commonJava { commonJava {
@ -46,3 +45,21 @@ artifacts {
clean { clean {
delete 'generated' delete 'generated'
} }
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'common')
}
}
}
sourceSets.configureEach {
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'common')
}
}
}
}

View File

@ -1,2 +1 @@
accessWidener v2 named classTweaker v1 official
# 不要用这个太垃圾了不支持parchment名

View File

@ -1,20 +1,13 @@
plugins { plugins {
id 'multiloader-loader' id 'multiloader-loader'
id 'fabric-loom' id 'net.fabricmc.fabric-loom'
} }
dependencies { dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}" minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered { implementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
officialMojangMappings() implementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip") implementation "curse.maven:jade-324717:8048381"
}
modImplementation(group: 'tschipp.carryon', name: 'carryon-fabric-1.21.1', version: '2.2.4.4') {
transitive = false
}
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
modImplementation "curse.maven:jade-324717:7545228"
testImplementation "net.fabricmc:fabric-loader-junit:${fabric_loader_version}" testImplementation "net.fabricmc:fabric-loader-junit:${fabric_loader_version}"
localRuntime 'net.covers1624:DevLogin:0.1.0.5' localRuntime 'net.covers1624:DevLogin:0.1.0.5'
} }
@ -96,7 +89,7 @@ tasks.named('javadoc', Javadoc) {
classpath += project(':common').sourceSets.main.compileClasspath classpath += project(':common').sourceSets.main.compileClasspath
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
options.charSet = 'UTF-8' options.charSet = 'UTF-8'
options.links("https://docs.oracle.com/en/java/javase/21/docs/api/") options.links("https://docs.oracle.com/en/java/javase/25/docs/api/")
options.memberLevel = JavadocMemberLevel.PUBLIC options.memberLevel = JavadocMemberLevel.PUBLIC
options.addBooleanOption('Xdoclint:none', true) options.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc") options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")
@ -117,49 +110,20 @@ tasks.named('build') {
dependsOn tasks.named('javadocJar') dependsOn tasks.named('javadocJar')
} }
// remap任务以包含sources和javadoc def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
remapJar { ['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements', 'includeInternal', 'modCompileClasspath'].each { variant ->
dependsOn tasks.named('sourcesJar') configurations.named("$variant") {
dependsOn tasks.named('javadocJar') attributes {
inputFile.set(tasks.named('jar').get().archiveFile) attribute(loaderAttribute, 'fabric')
addNestedDependencies = false }
}
} }
sourceSets.configureEach {
remapSourcesJar { [it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
dependsOn tasks.named('sourcesJar') configurations.named("$variant") {
inputFile.set(tasks.named('sourcesJar').get().archiveFile) attributes {
} attribute(loaderAttribute, 'fabric')
// remapped artifacts添加到发布配置
publishing {
publications {
mavenJava(MavenPublication) {
// artifactsId
artifactId = "${mod_id}-fabric-${minecraft_version}"
artifacts.clear()
// artifacts
artifact(remapJar) {
builtBy remapJar
}
artifact(remapSourcesJar) {
builtBy remapSourcesJar
classifier = 'sources'
}
artifact(javadocJar) {
builtBy javadocJar
classifier = 'javadoc'
} }
} }
} }
test {
useJUnitPlatform()
}
tasks.named('generateMetadataFileForMavenJavaPublication') {
dependsOn tasks.named('remapJar')
dependsOn tasks.named('remapSourcesJar')
dependsOn tasks.named('javadocJar')
}
} }

View File

@ -5,29 +5,26 @@
# Project # Project
version=0.5.6 version=0.5.6
group=top.r3944realms.lib39 group=top.r3944realms.lib39
java_version=21 java_version=25
# Common # Common
minecraft_version=1.21.1 minecraft_version=26.1.2
mod_name=3944Realms 's Lib Mod mod_name=3944Realms 's Lib Mod
mod_author=R3944Realms mod_author=R3944Realms
mod_id=lib39 mod_id=lib39
license=MIT license=MIT
credits=Logo created by Shanyi43, edited by R3944Realms credits=Logo created by Shanyi43, edited by R3944Realms
description=Lib39 is a general-purpose dependency library that provides utility methods and core functionality for other mods. description=Lib39 is a general-purpose dependency library that provides utility methods and core functionality for other mods.
minecraft_version_range=[1.20.1, 1.22) minecraft_version_range=[26.1.2, 26.2)
# The version of ParchmentMC that is used, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions neo_form_version=26.1.2-1
parchment_minecraft=1.21.1
parchment_version=2024.11.17
neo_form_version=1.21.1-20240808.144430
# NeoForge # NeoForge
neoforge_version=21.1.80 neoforge_version=26.1.2.7-beta
neoforge_loader_version_range=[4,) neoforge_loader_version_range=[4,)
# Fabric # Fabric
fabric_version=0.109.0+1.21.1 fabric_version=0.145.4+26.1.2
fabric_loader_version=0.16.9 fabric_loader_version=0.18.6
# Gradle # Gradle
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
@ -41,7 +38,7 @@ publish_curseforge=true
modrinth_id=n65Vs1Vk modrinth_id=n65Vs1Vk
curseforge_id=1445917 curseforge_id=1445917
java_versions=21 java_versions=25
fabric_modrinth_dependencies= fabric_modrinth_dependencies=
neoforge_modrinth_dependencies= neoforge_modrinth_dependencies=

35
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2015-2021 the original authors. # Copyright © 2015 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
# #
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -83,7 +85,8 @@ done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -111,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;; NONSTOP* ) nonstop=true ;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
@ -130,10 +132,13 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
@ -141,7 +146,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -149,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -166,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java # For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" ) JAVACMD=$( cygpath --unix "$JAVACMD" )
@ -198,16 +202,15 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command:
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# shell script including quotes and variable substitutions, so put them in # and any embedded shellness will be escaped.
# double quotes to make sure that they get re-expanded; and # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# * put everything else in single quotes, so that it's not re-expanded. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available. # Stop when "xargs" is not available.
@ -242,4 +245,4 @@ eval "set -- $(
tr '\n' ' ' tr '\n' ' '
)" '"$@"' )" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

View File

@ -18,10 +18,6 @@ neoForge {
if (at.exists()) { if (at.exists()) {
accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"] accessTransformers = ["src/main/resources/META-INF/accesstransformer.cfg"]
} }
parchment {
minecraftVersion = parchment_minecraft
mappingsVersion = parchment_version
}
runs { runs {
client { client {
client() client()
@ -36,7 +32,7 @@ neoForge {
) )
} }
data { data {
data() clientData()
// 使 // 使
programArguments.addAll( programArguments.addAll(
@ -64,12 +60,10 @@ neoForge {
sourceSets.main.resources.srcDir project(':common').file('src/generated/resources') sourceSets.main.resources.srcDir project(':common').file('src/generated/resources')
dependencies { dependencies {
compileOnly project(":common") implementation(group: 'tschipp.carryon', name: 'carryon-neoforge-26.1.2', version: '3.0.1') {
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:0.2.0"))
implementation(group: 'tschipp.carryon', name: 'carryon-neoforge-1.21.1', version: '2.2.4.4') {
transitive = false transitive = false
} }
implementation "curse.maven:jade-324717:7545219" implementation "curse.maven:jade-324717:8068368"
} }

View File

@ -10,39 +10,14 @@ pluginManagement {
} }
} }
filter { filter {
includeGroup('net.fabricmc') includeGroupAndSubgroups('net.fabricmc')
includeGroup('fabric-loom')
} }
} }
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = uri('https://repo.spongepowered.org/repository/maven-public')
}
}
filter {
includeGroupAndSubgroups("org.spongepowered")
}
}
exclusiveContent {
forRepository {
maven {
name = 'Forge'
url = uri('https://maven.minecraftforge.net')
}
}
filter {
includeGroupAndSubgroups('net.minecraftforge')
}
}
maven { url = 'https://maven.neoforged.net/releases' }
maven { url = 'https://maven.parchmentmc.org' } // Add this line
} }
} }
plugins { plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
} }
// This should match the folder name of the project, or else IDEA may complain (see https://youtrack.jetbrains.com/issue/IDEA-317606) // This should match the folder name of the project, or else IDEA may complain (see https://youtrack.jetbrains.com/issue/IDEA-317606)