--- a/folia-server/build.gradle.kts +++ b/folia-server/build.gradle.kts @@ -10,22 +10,35 @@ `java-library` `maven-publish` idea - id("io.papermc.paperweight.core") + id("moe.luminolmc.hyacinthusweight.core") id("io.papermc.fill.gradle") version "1.0.7" } val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/" + +repositories { + maven("https://maven.neoforged.net/releases") { + name = "NeoForged" + } +} dependencies { mache("io.papermc:mache:1.21.8+build.2") - paperclip("io.papermc:paperclip:3.0.3") + hyacinthusclip("moe.luminolmc:hyacinthusclip:+") testRuntimeOnly("org.junit.platform:junit-platform-launcher") + + // Neko Core: explicitly wire the mache remapper classpath. + // hyacinthusweight.core did not populate the `macheRemapper` configuration from + // mache.json, leaving RunCodebook with an empty remapper classpath + // ("{remapperFile} in args, but no remapperClasspath provided"). mache + // 1.21.8+build.2 expects AutoRenamingTool 2.0.5 (shaded `all` classifier). + "macheRemapper"("net.neoforged:AutoRenamingTool:2.0.5:all") { isTransitive = false } } paperweight { minecraftVersion = providers.gradleProperty("mcVersion") gitFilePatches = false - + val fork = forks.register("folia") { upstream.patchDir("paperServer") { upstreamPath = "paper-server" @@ -35,26 +48,17 @@ } } - activeFork = fork - - - spigot { - enabled = true - buildDataRef = "436eac9815c211be1a2a6ca0702615f995e81c44" - packageVersion = "v1_21_R5" // also needs to be updated in MappingEnvironment - } - - reobfPackagesToFix.addAll( - "co.aikar.timings", - "com.destroystokyo.paper", - "com.mojang", - "io.papermc.paper", - "ca.spottedleaf", - "net.kyori.adventure.bossbar", - "net.minecraft", - "org.bukkit.craftbukkit", - "org.spigotmc", - ) + val luminol = forks.register("luminol") { + forks.set(fork) + upstream.patchDir("foliaServer") { + upstreamPath = "folia-server" + excludes = setOf("src/minecraft", "patches", "build.gradle.kts") + patchesDir = rootDirectory.dir("luminol-server/paper-patches") + outputDir = rootDirectory.dir("folia-server") + } + } + + activeFork = luminol } tasks.generateDevelopmentBundle { @@ -121,8 +125,8 @@ sourceSets { main { - java { srcDir("../paper-server/src/main/java"); srcDir("../paper-server/src/generated/java") } - resources { srcDir("../paper-server/src/main/resources") } + java { srcDir("../paper-server/src/main/java"); srcDir("../paper-server/src/generated/java"); srcDir("../folia-server/src/main/java") } + resources { srcDir("../paper-server/src/main/resources"); srcDir("../folia-server/src/main/resources") } } test { java { srcDir("../paper-server/src/test/java") } @@ -153,7 +157,16 @@ } dependencies { - implementation(project(":folia-api")) + implementation(project(":luminol-api")) + // Luminol extra dependencies + implementation("org.apache.commons:commons-lang3:3.17.0") + implementation("com.github.luben:zstd-jni:1.5.6-10") + implementation("net.jpountz.lz4:lz4:1.3.0") + implementation("net.openhft:zero-allocation-hashing:0.27ea0") + implementation("io.github.classgraph:classgraph:4.8.179") + implementation("net.openhft:affinity:3.23.3") + implementation("org.spongepowered:configurate-gson:4.2.0") + implementation("org.jocl:jocl:2.0.5") 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 @@ -217,21 +230,21 @@ 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() // 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 "Folia", + "Implementation-Title" to "Luminol", "Implementation-Version" to implementationVersion, "Implementation-Vendor" to date, - "Specification-Title" to "Folia", + "Specification-Title" to "Luminol", "Specification-Version" to project.version, - "Specification-Vendor" to "Paper Team", - "Brand-Id" to "papermc:folia", - "Brand-Name" to "Folia", + "Specification-Vendor" to "LuminolMC org", + "Brand-Id" to "luminolmc:luminol", + "Brand-Name" to "Neko Core", "Build-Number" to (build ?: ""), "Build-Time" to buildTime.toString(), "Git-Branch" to gitBranch, @@ -358,14 +371,7 @@ tasks.registerRunTask("runServer") { description = "Spin up a test server from the Mojang mapped server jar" - classpath(tasks.includeMappings.flatMap { it.outputJar }) - classpath(configurations.runtimeClasspath) -} - -tasks.registerRunTask("runReobfServer") { - description = "Spin up a test server from the reobfJar output jar" - classpath(tasks.reobfJar.flatMap { it.outputJar }) - classpath(configurations.runtimeClasspath) + classpath(sourceSets.main.map { it.runtimeClasspath }) } tasks.registerRunTask("runDevServer") { @@ -375,27 +381,40 @@ tasks.registerRunTask("runBundler") { description = "Spin up a test server from the Mojang mapped bundler jar" - classpath(tasks.createMojmapBundlerJar.flatMap { it.outputZip }) - mainClass.set(null as String?) -} -tasks.registerRunTask("runReobfBundler") { - description = "Spin up a test server from the reobf bundler jar" - classpath(tasks.createReobfBundlerJar.flatMap { it.outputZip }) + classpath(tasks.named("createMojmapBundlerJar").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 }) + classpath(tasks.named("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?) + +afterEvaluate { + tasks.withType().configureEach { + val mappingsUri = "https://piston-data.mojang.com/v1/objects/eb1e1eb47cb740012fc82eacc394859463684132/server.txt" + val remapperUri = "https://maven.neoforged.net/releases/net/neoforged/AutoRenamingTool/2.0.5/AutoRenamingTool-2.0.5-all.jar" + val paramsUri = "https://repo.papermc.io/repository/maven-public/io/papermc/parchment/data/parchment-25w21a/2025.05.28/parchment-25w21a-2025.05.28.zip" + codebookArgs.set( + listOf( + "--temp-dir={tempDir}", + "--remapper-uri=$remapperUri", + "--mappings-uri=$mappingsUri", + "--params-uri=$paramsUri", + "--output={output}", + "--input={input}", + "--input-classpath={inputClasspath}", + "--hypo-parallelism=1", + ) + ) + doFirst { + logger.lifecycle("Neko Core: overridden macheRemapJar args = ${codebookArgs.get()}") + } + } } fill { - project("folia") + project("luminol") versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") }) version(paperweight.minecraftVersion) @@ -404,7 +423,7 @@ downloads { register("server:default") { - file = tasks.createMojmapPaperclipJar.flatMap { it.outputZip } + file = tasks.named("createMojmapPaperclipJar").flatMap { it.outputZip } nameResolver.set { project, _, version, build -> "$project-$version-$build.jar" } } }