mirror of
https://github.com/chylex/Better-Controls.git
synced 2025-01-07 01:42:47 +01:00
Update Gradle and build scripts for Minecraft 1.21
This commit is contained in:
parent
ead8c84549
commit
ffc5c00201
@ -18,7 +18,7 @@ runs {
|
||||
jvmArguments(runJvmArgs)
|
||||
}
|
||||
|
||||
create("client")
|
||||
removeIf { it.name != "client" }
|
||||
}
|
||||
|
||||
tasks.processResources {
|
||||
|
@ -24,7 +24,7 @@ val jarVersion = "$minecraftVersion+v$modVersion"
|
||||
plugins {
|
||||
idea
|
||||
`java-library`
|
||||
id("net.neoforged.gradle.vanilla")
|
||||
id("fabric-loom")
|
||||
}
|
||||
|
||||
idea {
|
||||
@ -46,18 +46,16 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("net.minecraft:client:$minecraftVersion")
|
||||
compileOnly("net.fabricmc:sponge-mixin:$mixinVersion")
|
||||
api("com.google.code.findbugs:jsr305:3.0.2")
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set("$modNameStripped-Common")
|
||||
}
|
||||
|
||||
runs {
|
||||
clear()
|
||||
dependencies {
|
||||
minecraft("com.mojang:minecraft:$minecraftVersion")
|
||||
mappings(loom.officialMojangMappings())
|
||||
|
||||
compileOnly("net.fabricmc:sponge-mixin:$mixinVersion")
|
||||
api("com.google.code.findbugs:jsr305:3.0.2")
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -66,10 +64,6 @@ allprojects {
|
||||
|
||||
apply(plugin = "java-library")
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains:annotations:24.1.0")
|
||||
}
|
||||
|
||||
extensions.getByType<JavaPluginExtension>().apply {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
@ -86,11 +80,15 @@ allprojects {
|
||||
if (project.javaToolchains.launcherFor(java.toolchain).map { it.metadata.vendor }.orNull == "JetBrains") {
|
||||
runJvmArgs.add("-XX:+AllowEnhancedClassRedefinition")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains:annotations:24.1.0")
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
dependencies {
|
||||
implementation(rootProject)
|
||||
implementation(project(rootProject.path, configuration = "namedElements"))
|
||||
}
|
||||
|
||||
base {
|
||||
@ -143,6 +141,25 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
runs {
|
||||
val runJvmArgs: Set<String> by project
|
||||
|
||||
configureEach {
|
||||
runDir("../run")
|
||||
vmArgs(runJvmArgs)
|
||||
ideConfigGenerated(true)
|
||||
}
|
||||
|
||||
named("client") {
|
||||
configName = "Vanilla Client"
|
||||
client()
|
||||
}
|
||||
|
||||
findByName("server")?.let(::remove)
|
||||
}
|
||||
}
|
||||
|
||||
val copyJars = tasks.register<Copy>("copyJars") {
|
||||
group = "build"
|
||||
duplicatesStrategy = EXCLUDE
|
||||
|
@ -9,16 +9,20 @@ modSourcesURL=https://github.com/chylex/Better-Controls
|
||||
modIssuesURL=https://github.com/chylex/Better-Controls/issues
|
||||
|
||||
# Dependencies
|
||||
minecraftVersion=1.20.5
|
||||
neoForgeVersion=20.5.0-beta
|
||||
neoGradleVersion=7.0.120
|
||||
minecraftVersion=1.21
|
||||
neoForgeVersion=21.0.0-beta
|
||||
neoGradleVersion=7.0.152
|
||||
fabricVersion=0.15.11
|
||||
loomVersion=1.3
|
||||
loomVersion=1.7
|
||||
mixinVersion=0.12.5+mixin.0.8.5
|
||||
|
||||
# https://projects.neoforged.net/neoforged/neogradle/
|
||||
# https://fabricmc.net/develop/
|
||||
# https://github.com/FabricMC/fabric-loom/releases
|
||||
|
||||
# Constraints
|
||||
minimumMinecraftVersion=1.20.5
|
||||
minimumNeoForgeVersion=20.5.0-beta
|
||||
minimumMinecraftVersion=1.21
|
||||
minimumNeoForgeVersion=21.0.0-beta
|
||||
minimumFabricVersion=0.12.3
|
||||
|
||||
# Gradle
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
2
gradlew
vendored
2
gradlew
vendored
@ -55,7 +55,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/.
|
||||
|
@ -10,7 +10,6 @@ pluginManagement {
|
||||
plugins {
|
||||
val neoGradleVersion = settings.extra.get("neoGradleVersion") as? String
|
||||
if (neoGradleVersion != null) {
|
||||
id("net.neoforged.gradle.vanilla") version neoGradleVersion
|
||||
id("net.neoforged.gradle.userdev") version neoGradleVersion
|
||||
id("net.neoforged.gradle.mixin") version neoGradleVersion
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user