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
violetc d5c9306a7f 1.21.4 (#413)
* init 1.21.4, and boom!

* build change, but weight not work

* just work

* Build changes, and delete timings

* Fix API patches (#406)

* Fix API patches

* merge

---------

Co-authored-by: violetc <58360096+s-yh-china@users.noreply.github.com>

* 0006/0129

* 0009/0129

* 0011/0129

* 0018/0129

* 0030/0129

* 0035/0129

* 0043/0129

* 0048/0129

* 0049/0129

* 0057/0129

* 0065/0129

* 0086/0129 (#408)

* 0072/0129

* 0080/0129

* Readd patch infos

* 0086/0129

* Delete applied patches

* 0087/0129

* 0091/0129

* 0097/0129

* 0101/0129

* 102/129

* 0107/0129

* 0112/0129

* 0118/0129

* 0129/0129, 100% patched

* fix some

* server work

* Protocol... (#409)

* Jade v7

* Fix changed part for Jade

* Formatting imports, add Lms Paster protocol

* REI payloads 5/8

* Add REI support, remove unnecessary content in Jade

* Rename

* Make jade better

* Make action work

* fix action jar

* Fix some protocol

* Fix bot action, and entity tickCount

* Fix Warden GameEventListener register on load

* Fix extra Raider drop

* Fix grindstone overstacking

* Update Paper, and some doc

* Merge

* [ci skip] Update Action

---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
2025-02-14 23:55:46 +08:00

156 lines
6.0 KiB
Diff

--- a/paper-server/build.gradle.kts
+++ b/paper-server/build.gradle.kts
@@ -5,14 +_,14 @@
plugins {
`java-library`
`maven-publish`
- id("io.papermc.paperweight.core")
+ id("org.leavesmc.leavesweight.core") // Leaves - build change
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
dependencies {
mache("io.papermc:mache:1.21.4+build.7")
- paperclip("io.papermc:paperclip:3.0.3")
+ leavesclip("org.leavesmc:leavesclip:2.0.1") // Leaves - build change
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
@@ -21,6 +_,18 @@
// macheOldPath = file("F:\\Projects\\PaperTooling\\mache\\versions\\1.21.4\\src\\main\\java")
// gitFilePatches = true
+ // 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 = "3edaf46ec1eed4115ce1b18d2846cded42577e42"
packageVersion = "v1_21_R3" // also needs to be updated in MappingEnvironment
@@ -101,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())
}
@@ -119,7 +_,13 @@
}
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
+ implementation("org.spongepowered:configurate-hocon:4.2.0-SNAPSHOT") // Leaves - leaves plugins
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
@@ -176,6 +_,16 @@
implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT")
}
+// 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)
@@ -188,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,
@@ -306,6 +_,14 @@
classpath(sourceSets.main.map { it.runtimeClasspath })
}
+// 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
+
tasks.registerRunTask("runBundler") {
description = "Spin up a test server from the Mojang mapped bundler jar"
classpath(tasks.createMojmapBundlerJar.flatMap { it.outputZip })
@@ -316,13 +_,15 @@
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"
+ 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"
+ classpath(tasks.createReobfLeavesclipJar.flatMap { it.outputZip })
+ mainClass.set(null as String?)
+}
+// Leaves end - build change