--- 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 { + 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