mirror of
https://github.com/LeavesMC/Leaves.git
synced 2026-01-03 14:22:09 +00:00
* update paper & gradle * Modify merge ItemEntity logic Add followTickSequenceMerge to modify merge items, due to Paper's modification of the merge radius, when the merge radius is large and stacks containing many items get stuck in an unexpected position, individual items may never reach their destination. This configuration option is added to fix this behavior. * add comments
225 lines
9.0 KiB
Diff
225 lines
9.0 KiB
Diff
--- a/paper-server/build.gradle.kts
|
|
+++ b/paper-server/build.gradle.kts
|
|
@@ -1,4 +_,3 @@
|
|
-import io.papermc.fill.model.BuildChannel
|
|
import io.papermc.paperweight.attribute.DevBundleOutput
|
|
import io.papermc.paperweight.util.*
|
|
import io.papermc.paperweight.util.data.FileEntry
|
|
@@ -10,22 +_,34 @@
|
|
`java-library`
|
|
`maven-publish`
|
|
idea
|
|
- id("io.papermc.paperweight.core")
|
|
- id("io.papermc.fill.gradle") version "1.0.7"
|
|
+ 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.10-rc1+build.5")
|
|
- paperclip("io.papermc:paperclip:3.0.3")
|
|
+ leavesclip("org.leavesmc:leavesclip:3.0.7") // 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
|
|
|
|
+ // 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 {
|
|
enabled = false
|
|
buildDataRef = "436eac9815c211be1a2a6ca0702615f995e81c44"
|
|
@@ -49,6 +_,7 @@
|
|
libraryRepositories.addAll(
|
|
"https://repo.maven.apache.org/maven2/",
|
|
paperMavenPublicUrl,
|
|
+ leavesMavenPublicUrl // Leaves - build change
|
|
)
|
|
}
|
|
|
|
@@ -107,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 +_,19 @@
|
|
}
|
|
|
|
dependencies {
|
|
- implementation(project(":paper-api"))
|
|
+ implementation(project(":leaves-api")) // Leaves - build change
|
|
+ implementation("commons-lang:commons-lang:2.6") // 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.5")
|
|
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,7 +_,6 @@
|
|
implementation("org.spongepowered:configurate-yaml:4.2.0")
|
|
|
|
// 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")
|
|
@@ -188,26 +_,36 @@
|
|
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)
|
|
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
|
val build = System.getenv("BUILD_NUMBER") ?: null
|
|
- val buildTime = if (build != null) Instant.now() else Instant.EPOCH
|
|
+ val buildTime = Instant.now() // Leaves - always use build time
|
|
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
|
|
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
|
|
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
|
|
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,
|
|
@@ -266,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() // Leaves - build change
|
|
idea {
|
|
module {
|
|
generatedSourceDirs.add(generatedDir.toFile())
|
|
@@ -303,6 +_,10 @@
|
|
}
|
|
|
|
args("--nogui")
|
|
+ systemProperty("stdout.encoding", "UTF-8") // Leaves - fix utf8
|
|
+ systemProperty("stderr.encoding", "UTF-8") // Leaves - fix utf8
|
|
+ systemProperty("net.kyori.ansi.colorLevel", "truecolor") // Leaves - fix utf8
|
|
+ systemProperty("terminal.jline", true) // Leaves - fix utf8
|
|
systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
|
if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") {
|
|
systemProperty("disable.watchdog", true)
|
|
@@ -347,30 +_,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?)
|
|
-}
|
|
-
|
|
-fill {
|
|
- project("paper")
|
|
- versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
|
- version(paperweight.minecraftVersion)
|
|
-
|
|
- build {
|
|
- channel = BuildChannel.ALPHA
|
|
-
|
|
- downloads {
|
|
- register("server:default") {
|
|
- file = tasks.createMojmapPaperclipJar.flatMap { it.outputZip }
|
|
- nameResolver.set { project, _, version, build -> "$project-$version-$build.jar" }
|
|
- }
|
|
- }
|
|
- }
|
|
-}
|
|
+
|
|
+// 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
|