9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/build.gradle.kts.patch
Lumine1909 f09fbb247d 1.21.5 (#470)
---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>
Co-authored-by: Fortern <blueten.ki@gmail.com>
Co-authored-by: MC_XiaoHei <xor7xiaohei@gmail.com>
Co-authored-by: Helvetica Volubi <88063803+Suisuroru@users.noreply.github.com>
Co-authored-by: MC_XiaoHei <xiaohei.xor7@outlook.com>
2025-06-05 18:41:51 +08:00

191 lines
7.5 KiB
Diff

--- a/paper-server/build.gradle.kts
+++ b/paper-server/build.gradle.kts
@@ -9,25 +_,38 @@
`java-library`
`maven-publish`
idea
- id("io.papermc.paperweight.core")
+ id("org.leavesmc.leavesweight.core") // Leaves - build change
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
+val leavesMavenPublicUrl = "https://repo.leavesmc.com/snapshots/" // Leaves - build change
dependencies {
mache("io.papermc:mache:1.21.5+build.2")
- paperclip("io.papermc:paperclip:3.0.3")
+ leavesclip("org.leavesmc:leavesclip:3.0.0") // Leaves - build change
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
paperweight {
- minecraftVersion = providers.gradleProperty("mcVersion")
+ minecraftVersion = rootProject.providers.gradleProperty("mcVersion") // Leaves - build change
gitFilePatches = false
//updatingMinecraft {
// oldPaperCommit = "f4f275519f7c1fbe9db173b7144a4fe81440e365"
//}
+ // Leaves start - build change
+ val leaves = forks.register("leaves") {
+ upstream.patchDir("paperServer") {
+ upstreamPath = "paper-server"
+ excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
+ patchesDir = rootDirectory.dir("leaves-server/paper-patches")
+ outputDir = rootDirectory.dir("paper-server")
+ }
+ }
+ activeFork = leaves
+ // Leaves end - build change
+
spigot {
buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
packageVersion = "v1_21_R4" // also needs to be updated in MappingEnvironment
@@ -50,6 +_,7 @@
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
+ leavesMavenPublicUrl // Leaves - build change
)
}
@@ -108,7 +_,22 @@
}
}
-val log4jPlugins = sourceSets.create("log4jPlugins")
+// Leaves start - build change
+sourceSets {
+ main {
+ java { srcDir("../paper-server/src/main/java") }
+ resources { srcDir("../paper-server/src/main/resources") }
+ }
+ test {
+ java { srcDir("../paper-server/src/test/java") }
+ resources { srcDir("../paper-server/src/test/resources") }
+ }
+}
+val log4jPlugins = sourceSets.create("log4jPlugins") {
+ java { srcDir("../paper-server/src/log4jPlugins/java") }
+}
+// Leaves end - build change
+
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
extendsFrom(configurations.compileClasspath.get())
}
@@ -130,7 +_,18 @@
}
dependencies {
- implementation(project(":paper-api"))
+ implementation(project(":leaves-api")) // Leaves - build change
+ // Leaves start - linear
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
+ implementation("org.lz4:lz4-java:1.8.0")
+ implementation("net.openhft:zero-allocation-hashing:0.16")
+ // Leaves end - linear
+ // Leaves start - leaves plugin
+ implementation("org.spongepowered:configurate-gson:4.2.0-SNAPSHOT") {
+ exclude(group = "com.google.code.gson", module = "gson")
+ exclude(group = "com.google.guava", module = "guava")
+ }
+ // Leaves end - leaves plugin
implementation("ca.spottedleaf:concurrentutil:0.0.3")
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
@@ -157,9 +_,9 @@
implementation("org.ow2.asm:asm-commons:9.8")
implementation("org.spongepowered:configurate-yaml:4.2.0-20250225.064233-199")
implementation("org.spongepowered:configurate-core:4.2.0-20250225.064233-204") // Pinned dependency of above pinned yaml snapshot.
+ implementation("commons-lang:commons-lang:2.6") // Leaves
// Deps that were previously in the API but have now been moved here for backwards compat, eventually to be removed
- runtimeOnly("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0")
runtimeOnly("com.mysql:mysql-connector-j:9.2.0")
runtimeOnly("com.lmax:disruptor:3.4.4")
@@ -194,6 +_,16 @@
implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
}
+// Leaves start - hide irrelevant compilation warnings
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("-Xlint:-module")
+ compilerArgs.add("-Xlint:-removal")
+ compilerArgs.add("-Xlint:-dep-ann")
+ compilerArgs.add("--add-modules=jdk.incubator.vector") // SIMD
+}
+// Leaves end - hide irrelevant compilation warnings
+
tasks.jar {
manifest {
val git = Git(rootProject.layout.projectDirectory.path)
@@ -206,14 +_,14 @@
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Paper",
+ "Implementation-Title" to "Leaves", // Leaves - build change
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date,
- "Specification-Title" to "Paper",
+ "Specification-Title" to "Leaves", // Leaves - build change
"Specification-Version" to project.version,
- "Specification-Vendor" to "Paper Team",
- "Brand-Id" to "papermc:paper",
- "Brand-Name" to "Paper",
+ "Specification-Vendor" to "Leaves Team", // Leaves - build change
+ "Brand-Id" to "leavesmc:leaves", // Leaves - build change
+ "Brand-Name" to "Leaves", // Leaves - build change
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch,
@@ -267,7 +_,7 @@
jvmArgumentProviders.add(provider)
}
-val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
+val generatedDir: java.nio.file.Path = rootProject.layout.projectDirectory.dir("paper-server/src/generated/java").asFile.toPath()
idea {
module {
generatedSourceDirs.add(generatedDir.toFile())
@@ -360,13 +_,26 @@
classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip })
mainClass.set(null as String?)
}
-tasks.registerRunTask("runPaperclip") {
- description = "Spin up a test server from the Mojang mapped Paperclip jar"
- classpath(tasks.createMojmapPaperclipJar.flatMap { it.outputZip })
- mainClass.set(null as String?)
-}
-tasks.registerRunTask("runReobfPaperclip") {
- description = "Spin up a test server from the reobf Paperclip jar"
- classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
- mainClass.set(null as String?)
-}
+
+// Leaves start - build change
+tasks.registerRunTask("runLeavesclip") {
+ description = "Spin up a test server from the Mojang mapped Leavesclip jar"
+ systemProperty("leavesclip.enable.mixin", true)
+ classpath(tasks.createMojmapLeavesclipJar.flatMap { it.outputZip })
+ mainClass.set(null as String?)
+}
+tasks.registerRunTask("runReobfLeavesclip") {
+ description = "Spin up a test server from the reobf Leavesclip jar"
+ systemProperty("leavesclip.enable.mixin", true)
+ classpath(tasks.createMojmapLeavesclipJar.flatMap { it.outputZip })
+ mainClass.set(null as String?)
+}
+// Leaves end - build change
+
+// Leaves start - create config file
+tasks.registerRunTask("createLeavesConfig") {
+ description = "Create a new leaves.yml"
+ mainClass = "org.leavesmc.leaves.config.GlobalConfigCreator"
+ classpath(sourceSets.main.map { it.runtimeClasspath })
+}
+// Leaves end - create config file