mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@88a3a870 Configurable xp orb merge group count (#12503) PaperMC/Paper@53d1d04e Disable Item Obfuscation for entity related stacks (#12297) PaperMC/Paper@c98cd658 Add configuration interface to expose certain config values (#12273) PaperMC/Paper@42a2a6c2 Supports the ability for commands to be registered internally (#12520) PaperMC/Paper@753cff7c Improvements for Dump paper commands (#12512) PaperMC/Paper@e2da5d2f Registry API for supported Mob Variants (#12417) PaperMC/Paper@ab0253fe Expand PlayerDeathEvent API (#12221) PaperMC/Paper@cbcf75a5 Update visual fire handling with TriState support (#12303) PaperMC/Paper@6c3964d2 Properly save level data async (#12530) PaperMC/Paper@d2ad2e66 Add missing EntityLookup#getAllMapped from Moonrise PaperMC/Paper@358e72ec Remove simplify remote item matching stuff for now PaperMC/Paper@04ffca0b Also remove CraftPlayer methods PaperMC/Paper@a2525819 Update mache PaperMC/Paper@d683970d Add FishHookStateChangeEvent (#12165) PaperMC/Paper@369ad170 Cached tag parser for itemstack reading (#12547) PaperMC/Paper@841d6342 Fix ItemStack#addUnsafeEnchantment ignored for missing enchantment component (#12549) PaperMC/Paper@c000b352 fix(bukkit-brig-forwarding-map): Invert isEmpty method (#12555) PaperMC/Paper@28d7df75 Backport HeroesOfTheVillage datafixer fix PaperMC/Paper@f1dbed07 Implement BlocksAttack DamageReduction and ItemDamage (#12538) PaperMC/Paper@cc38032b Deprecate TeleportCause CHORUS_FRUIT for CONSUMABLE_EFFECT (#12546) PaperMC/Paper@35878677 [ci/skip] Fix format and mentions for ItemDamageFunction (#12560) PaperMC/Paper@7171d299 [ci/skip] Mention CAN_PLACE/CAN_BREAK component in ItemMeta (#12559) PaperMC/Paper@6f73e62e Add getPickItemStack (#12552) PaperMC/Paper@ce0fa4c4 Replace old version command with brigadier equivalent (#12502) PaperMC/Paper@fa360aa8 Add some missing annotations and an incorrect one (#12204) PaperMC/Paper@113b18ee Update paperweight and Gradle wrapper (#12573) PaperMC/Paper@f303a076 fix: Don't hardcode checks for translation registries (#12571) PaperMC/Paper@87349c31 Fix CombatTracker stale on death (#12562) PaperMC/Paper@b70bca6b Revert "fix: Don't hardcode checks for translation registries (#12571)" Purpur Changes: PurpurMC/Purpur@93011bc1 Add configuration setting to re-add End void rings (#1656) PurpurMC/Purpur@c2f48591 [ci/skip] only set default world config values once PurpurMC/Purpur@6f5bbae5 [ci/skip] move some code around PurpurMC/Purpur@5c1a9835 fix issue with `shift-right-click-repairs-mending-points` PurpurMC/Purpur@3156e446 check damage value of tool correctly PurpurMC/Purpur@a9fe4f25 Updated Upstream (Paper) PurpurMC/Purpur@9d0aa8eb Updated Upstream (Paper) PurpurMC/Purpur@603c7557 Updated Upstream (Paper) PurpurMC/Purpur@eca78060 Updated Upstream (Paper) PurpurMC/Purpur@e4e9cfdf Updated Upstream (Paper) PurpurMC/Purpur@3de2fc7d Updated Upstream (Paper) PurpurMC/Purpur@09f547de add `mob-griefing-override` config options (#1661) PurpurMC/Purpur@1dd9bd0c Updated Upstream (Paper) PurpurMC/Purpur@7a8aa86a finish updating gradle PurpurMC/Purpur@fd78b90f bandaid fix: increase the daemon heap for now
293 lines
13 KiB
Diff
293 lines
13 KiB
Diff
--- a/paper-server/build.gradle.kts
|
|
+++ b/paper-server/build.gradle.kts
|
|
@@ -13,10 +_,11 @@
|
|
}
|
|
|
|
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
|
+val leafMavenPublicUrl = "https://maven.nostal.ink/repository/maven-snapshots/" // Leaf - project setup - Add publish repo
|
|
|
|
dependencies {
|
|
mache("io.papermc:mache:1.21.5+build.2")
|
|
- paperclip("io.papermc:paperclip:3.0.3")
|
|
+ paperclip("cn.dreeam:quantumleaper:1.0.0-SNAPSHOT") // Leaf - project setup - Use own paperclip fork
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
}
|
|
|
|
@@ -28,6 +_,19 @@
|
|
// oldPaperCommit = "f4f275519f7c1fbe9db173b7144a4fe81440e365"
|
|
//}
|
|
|
|
+ // Leaf start - project setup
|
|
+ val leaf = forks.register("leaf") {
|
|
+ upstream.patchDir("paperServer") {
|
|
+ upstreamPath = "paper-server"
|
|
+ excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
|
+ patchesDir = rootDirectory.dir("leaf-server/paper-patches")
|
|
+ outputDir = rootDirectory.dir("paper-server")
|
|
+ }
|
|
+ }
|
|
+
|
|
+ activeFork = leaf
|
|
+ // Leaf end - project setup
|
|
+
|
|
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,
|
|
+ leafMavenPublicUrl // Leaf - project setup - Add publish repo
|
|
)
|
|
}
|
|
|
|
@@ -108,7 +_,22 @@
|
|
}
|
|
}
|
|
|
|
-val log4jPlugins = sourceSets.create("log4jPlugins")
|
|
+// Leaf start - project setup
|
|
+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") }
|
|
+}
|
|
+// Leaf end - project setup
|
|
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
|
extendsFrom(configurations.compileClasspath.get())
|
|
}
|
|
@@ -130,10 +_,20 @@
|
|
}
|
|
|
|
dependencies {
|
|
- implementation(project(":paper-api"))
|
|
+ implementation(project(":leaf-api")) // Leaf - project setup
|
|
+
|
|
+ // Leaf start - Libraries
|
|
+ implementation("com.github.thatsmusic99:ConfigurationMaster-API:v2.0.0-rc.3") { // Leaf config
|
|
+ exclude(group = "org.yaml", module = "snakeyaml")
|
|
+ }
|
|
+ implementation("com.github.luben:zstd-jni:1.5.7-1") // LinearPaper
|
|
+ implementation("org.lz4:lz4-java:1.8.0") // LinearPaper
|
|
+ implementation("com.github.ben-manes.caffeine:caffeine:3.2.0")
|
|
+ // Leaf end - Libraries
|
|
+
|
|
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
|
|
+ implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+ // Leaf - Bump Dependencies
|
|
+ implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21 // Leaf - Bump Dependencies
|
|
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
|
implementation("net.kyori:adventure-text-serializer-ansi:4.21.0") // Keep in sync with adventureVersion from Paper-API build file
|
|
runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
|
|
@@ -144,41 +_,58 @@
|
|
all its classes to check if they are plugins.
|
|
Scanning takes about 1-2 seconds so adding this speeds up the server start.
|
|
*/
|
|
- implementation("org.apache.logging.log4j:log4j-core:2.24.1")
|
|
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.24.1") // Needed to generate meta for our Log4j plugins
|
|
+ // Leaf start - Bump Dependencies
|
|
+ implementation("org.apache.logging.log4j:log4j-core:2.24.3")
|
|
+ log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.24.3") // Needed to generate meta for our Log4j plugins
|
|
+ // Leaf end - Bump Dependencies
|
|
runtimeOnly(log4jPlugins.output)
|
|
alsoShade(log4jPlugins.output)
|
|
|
|
implementation("com.velocitypowered:velocity-native:3.4.0-SNAPSHOT") {
|
|
isTransitive = false
|
|
}
|
|
- implementation("io.netty:netty-codec-haproxy:4.1.118.Final") // Add support for proxy protocol
|
|
- implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1")
|
|
+ // Leaf start - Bump Dependencies
|
|
+ implementation("io.netty:netty-codec-haproxy:4.1.119.Final") // Add support for proxy protocol
|
|
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.24.3")
|
|
+ // Leaf end - Bump Dependencies
|
|
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.
|
|
|
|
+ // Purpur start
|
|
+ implementation("org.mozilla:rhino-runtime:1.7.15")
|
|
+ implementation("org.mozilla:rhino-engine:1.7.15")
|
|
+ implementation("dev.omega24:upnp4j:1.0")
|
|
+ // Purpur end
|
|
+
|
|
// 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")
|
|
+ runtimeOnly("com.mysql:mysql-connector-j:9.2.0") {
|
|
+ exclude("com.google.protobuf", "protobuf-java") // Leaf - Exclude outdated protobuf version
|
|
+ }
|
|
+ runtimeOnly("com.google.protobuf:protobuf-java:4.30.1")
|
|
+ // Leaf start - Bump Dependencies
|
|
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Dreeam TODO - Waiting Log4j 3.x to support disruptor 4.0.0
|
|
implementation("com.googlecode.json-simple:json-simple:1.1.1") { // change to runtimeOnly once Timings is removed
|
|
isTransitive = false // includes junit
|
|
}
|
|
|
|
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
|
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
|
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
|
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.9")
|
|
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.22") // Dreeam TODO - Update to 2.0.1
|
|
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.22") // Dreeam TODO - Update to 2.0.1
|
|
+ // Leaf end - Bump Dependencies
|
|
|
|
testImplementation("io.github.classgraph:classgraph:4.8.179") // For mob goal test
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
|
|
testImplementation("org.junit.platform:junit-platform-suite-engine:1.12.2")
|
|
- testImplementation("org.hamcrest:hamcrest:2.2")
|
|
- testImplementation("org.mockito:mockito-core:5.14.1")
|
|
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Configure mockito agent that is needed in newer java versions
|
|
+ // Leaf start - Bump Dependencies
|
|
+ testImplementation("org.hamcrest:hamcrest:3.0")
|
|
+ testImplementation("org.mockito:mockito-core:5.16.1")
|
|
+ mockitoAgent("org.mockito:mockito-core:5.16.1") { isTransitive = false } // Configure mockito agent that is needed in newer java versions
|
|
testImplementation("org.ow2.asm:asm-tree:9.8")
|
|
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // CartesianTest
|
|
+ testImplementation("org.junit-pioneer:junit-pioneer:2.3.0") // CartesianTest
|
|
+ // Leaf end - Bump Dependencies
|
|
|
|
implementation("net.neoforged:srgutils:1.0.9") // Mappings handling
|
|
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Remap plugins
|
|
@@ -192,28 +_,40 @@
|
|
// Spark
|
|
implementation("me.lucko:spark-api:0.1-20240720.200737-2")
|
|
implementation("me.lucko:spark-paper:1.10.133-20250413.112336-1")
|
|
-}
|
|
+
|
|
+ implementation("io.netty:netty-all:4.1.119.Final") // Leaf - Bump Dependencies // Dreeam TODO - Update to 4.2.0
|
|
+}
|
|
+
|
|
+// Gale 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") // Gale - Pufferfish - SIMD support
|
|
+}
|
|
+// Gale 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() // Leaf - project setup - Always use current as 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 "Leaf", // Leaf - Rebrand
|
|
"Implementation-Version" to implementationVersion,
|
|
"Implementation-Vendor" to date,
|
|
- "Specification-Title" to "Paper",
|
|
+ "Specification-Title" to "Leaf", // Leaf - Rebrand
|
|
"Specification-Version" to project.version,
|
|
- "Specification-Vendor" to "Paper Team",
|
|
- "Brand-Id" to "papermc:paper",
|
|
- "Brand-Name" to "Paper",
|
|
+ "Specification-Vendor" to "Winds Studio", // Leaf - Rebrand
|
|
+ "Brand-Id" to "winds-studio:leaf", // Leaf - Rebrand
|
|
+ "Brand-Name" to "Leaf", // Leaf - Rebrand
|
|
"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() // Leaf - project setup
|
|
idea {
|
|
module {
|
|
generatedSourceDirs.add(generatedDir.toFile())
|
|
@@ -325,6 +_,8 @@
|
|
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
|
|
minHeapSize = "${memoryGb}G"
|
|
maxHeapSize = "${memoryGb}G"
|
|
+ jvmArgs("--enable-preview") // Gale - enable preview features for development runs
|
|
+ jvmArgs("--add-modules=jdk.incubator.vector") // Gale - Pufferfish - SIMD support
|
|
|
|
doFirst {
|
|
workingDir.mkdirs()
|
|
@@ -370,3 +_,62 @@
|
|
classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
|
|
mainClass.set(null as String?)
|
|
}
|
|
+
|
|
+// Gale start - package license into jar
|
|
+tasks.register<Copy>("copyLicense") {
|
|
+ from(layout.projectDirectory.file("../paper-server/LICENSE.txt"))
|
|
+ into(layout.buildDirectory.dir("tmp/copiedlicense"))
|
|
+}
|
|
+
|
|
+tasks.processResources {
|
|
+ dependsOn("copyLicense")
|
|
+}
|
|
+
|
|
+sourceSets {
|
|
+ main {
|
|
+ resources {
|
|
+ srcDir(layout.buildDirectory.dir("tmp/copiedlicense"))
|
|
+ }
|
|
+ }
|
|
+}
|
|
+// Gale end - package license into jar
|
|
+
|
|
+// Gale start - branding changes - package license into jar
|
|
+// Based on io.papermc.paperweight.core.taskcontainers.PaperclipTasks
|
|
+tasks.named("createMojmapPaperclipJar") {
|
|
+ val name = rootProject.name
|
|
+ val version = project.version
|
|
+ val licenseFileName = "LICENSE.txt"
|
|
+ val licenseFilePath = layout.projectDirectory.dir("../paper-server/$licenseFileName").asFile
|
|
+
|
|
+ // Based on io.papermc.paperweight.core.taskcontainers.PaperclipTasks
|
|
+ val jarName = listOfNotNull(
|
|
+ name,
|
|
+ "paperclip",
|
|
+ version,
|
|
+ "mojmap"
|
|
+ ).joinToString("-") + ".jar"
|
|
+
|
|
+ // Based on io.papermc.paperweight.core.taskcontainers.PaperclipTasks
|
|
+ val zipFile = layout.buildDirectory.file("libs/$jarName").get().path
|
|
+
|
|
+ val rootDir = findOutputDir(zipFile)
|
|
+
|
|
+ doLast {
|
|
+
|
|
+ try {
|
|
+ unzip(zipFile, rootDir)
|
|
+
|
|
+ licenseFilePath.copyTo(rootDir.resolve(licenseFileName).toFile())
|
|
+
|
|
+ ensureDeleted(zipFile)
|
|
+
|
|
+ zip(rootDir, zipFile)
|
|
+ } finally {
|
|
+ @OptIn(kotlin.io.path.ExperimentalPathApi::class)
|
|
+ rootDir.toFile().deleteRecursively()
|
|
+ }
|
|
+
|
|
+ }
|
|
+}
|
|
+// Gale end - branding changes - package license into jar
|