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 {
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
}

View File

@ -26,19 +26,6 @@ repositories {
}
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 {
url "https://cursemaven.com"
@ -48,25 +35,13 @@ repositories {
name = 'BlameJared'
url = 'https://maven.blamejared.com'
}
repositories {
maven {
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 {
from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" }
@ -112,9 +87,18 @@ processResources {
'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
}
filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
expand jsonExpandProps
}
inputs.properties(expandProps)
}
@ -137,7 +121,7 @@ publishing {
licenses {
license {
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'
}
}

View File

@ -13,8 +13,9 @@ configurations {
dependencies {
compileOnly(project(':common')) {
capabilities {
requireCapability "$group:$mod_id"
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
attributes {
attribute(loaderAttribute, 'common')
}
}
commonJava project(path: ':common', configuration: 'commonJava')
@ -36,7 +37,7 @@ tasks.named('javadoc', Javadoc).configure {
source(configurations.commonJava)
options.encoding = '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.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")

View File

@ -10,22 +10,21 @@ neoForge {
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
parchment {
minecraftVersion = parchment_minecraft
mappingsVersion = parchment_version
}
}
dependencies {
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
}
// 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'
annotationProcessor 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.5.3'
}
configurations {
commonJava {
@ -46,3 +45,21 @@ artifacts {
clean {
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
# 不要用这个太垃圾了不支持parchment名
classTweaker v1 official

View File

@ -1,20 +1,13 @@
plugins {
id 'multiloader-loader'
id 'fabric-loom'
id 'net.fabricmc.fabric-loom'
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip")
}
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"
implementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
implementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation "curse.maven:jade-324717:8048381"
testImplementation "net.fabricmc:fabric-loader-junit:${fabric_loader_version}"
localRuntime 'net.covers1624:DevLogin:0.1.0.5'
}
@ -96,7 +89,7 @@ tasks.named('javadoc', Javadoc) {
classpath += project(':common').sourceSets.main.compileClasspath
options.encoding = '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.addBooleanOption('Xdoclint:none', true)
options.addStringOption('doctitle', "${mod_id} ${minecraft_version} ${version} Javadoc")
@ -117,49 +110,20 @@ tasks.named('build') {
dependsOn tasks.named('javadocJar')
}
// remap任务以包含sources和javadoc
remapJar {
dependsOn tasks.named('sourcesJar')
dependsOn tasks.named('javadocJar')
inputFile.set(tasks.named('jar').get().archiveFile)
addNestedDependencies = false
def loaderAttribute = Attribute.of('io.github.mcgradleconventions.loader', String)
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements', 'includeInternal', 'modCompileClasspath'].each { variant ->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'fabric')
}
}
}
remapSourcesJar {
dependsOn tasks.named('sourcesJar')
inputFile.set(tasks.named('sourcesJar').get().archiveFile)
}
// 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')
}
sourceSets.configureEach {
[it.compileClasspathConfigurationName, it.runtimeClasspathConfigurationName].each { variant->
configurations.named("$variant") {
attributes {
attribute(loaderAttribute, 'fabric')
}
}
}
}

View File

@ -5,29 +5,26 @@
# Project
version=0.5.6
group=top.r3944realms.lib39
java_version=21
java_version=25
# Common
minecraft_version=1.21.1
minecraft_version=26.1.2
mod_name=3944Realms 's Lib Mod
mod_author=R3944Realms
mod_id=lib39
license=MIT
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.
minecraft_version_range=[1.20.1, 1.22)
# The version of ParchmentMC that is used, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions
parchment_minecraft=1.21.1
parchment_version=2024.11.17
neo_form_version=1.21.1-20240808.144430
minecraft_version_range=[26.1.2, 26.2)
neo_form_version=26.1.2-1
# NeoForge
neoforge_version=21.1.80
neoforge_version=26.1.2.7-beta
neoforge_loader_version_range=[4,)
# Fabric
fabric_version=0.109.0+1.21.1
fabric_loader_version=0.16.9
fabric_version=0.145.4+26.1.2
fabric_loader_version=0.18.6
# Gradle
org.gradle.jvmargs=-Xmx3G
@ -41,7 +38,7 @@ publish_curseforge=true
modrinth_id=n65Vs1Vk
curseforge_id=1445917
java_versions=21
java_versions=25
fabric_modrinth_dependencies=
neoforge_modrinth_dependencies=

33
gradlew vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (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
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (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.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -83,7 +85,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
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.
MAX_FD=maximum
@ -111,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@ -130,10 +132,13 @@ location of your Java installation."
fi
else
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
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@ -141,7 +146,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# 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 ) ||
warn "Could not query maximum file descriptor limit"
esac
@ -149,7 +154,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# 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" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@ -166,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
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.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

View File

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

View File

@ -10,39 +10,14 @@ pluginManagement {
}
}
filter {
includeGroup('net.fabricmc')
includeGroup('fabric-loom')
includeGroupAndSubgroups('net.fabricmc')
}
}
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 {
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)