2026-07-09 00:03:09 +08:00
|
|
|
--- a/folia-server/build.gradle.kts
|
|
|
|
|
+++ b/folia-server/build.gradle.kts
|
|
|
|
|
@@ -24,6 +_,7 @@
|
|
|
|
|
gitFilePatches = false
|
|
|
|
|
|
|
|
|
|
val fork = forks.register("folia") {
|
|
|
|
|
+ rootDirectory = upstreamsDirectory().map { it.dir("folia") }
|
|
|
|
|
upstream.patchDir("paperServer") {
|
|
|
|
|
upstreamPath = "paper-server"
|
|
|
|
|
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
|
|
|
|
|
@@ -32,7 +_,23 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- activeFork = fork
|
2026-07-14 13:29:52 +08:00
|
|
|
+ val shiroha = forks.register("shiroha") {
|
2026-07-09 00:03:09 +08:00
|
|
|
+ forks = fork
|
|
|
|
|
+ upstream.patchRepo("paperServer") {
|
|
|
|
|
+ upstreamRepo = fork.patchedRepo("paperServer")
|
2026-07-14 13:29:52 +08:00
|
|
|
+ patchesDir = rootDirectory.dir("shiroha-server/paper-patches")
|
2026-07-09 00:03:09 +08:00
|
|
|
+ outputDir = rootDirectory.dir("paper-server")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ upstream.patchDir("foliaServer") {
|
|
|
|
|
+ upstreamPath = "folia-server"
|
|
|
|
|
+ excludes = setOf("src/minecraft", "paper-patches", "minecraft-patches", "build.gradle.kts", "build.gradle.kts.patch")
|
2026-07-14 13:29:52 +08:00
|
|
|
+ patchesDir = rootDirectory.dir("shiroha-server/folia-patches")
|
2026-07-09 00:03:09 +08:00
|
|
|
+ outputDir = rootDirectory.dir("folia-server")
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
2026-07-14 13:29:52 +08:00
|
|
|
+ activeFork = shiroha
|
2026-07-09 00:03:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
updatingMinecraft {
|
|
|
|
|
@@ -103,10 +_,14 @@
|
|
|
|
|
main {
|
2026-08-11 15:18:51 +08:00
|
|
|
java { srcDir("../paper-server/src/main/java") }
|
2026-07-09 00:03:09 +08:00
|
|
|
resources { srcDir("../paper-server/src/main/resources") }
|
|
|
|
|
+ java { srcDir("../folia-server/src/main/java") }
|
|
|
|
|
+ resources { srcDir("../folia-server/src/main/resources") }
|
|
|
|
|
}
|
|
|
|
|
test {
|
|
|
|
|
java { srcDir("../paper-server/src/test/java") }
|
|
|
|
|
resources { srcDir("../paper-server/src/test/resources") }
|
|
|
|
|
+ java { srcDir("../folia-server/src/test/java") }
|
|
|
|
|
+ resources { srcDir("../folia-server/src/test/resources") }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
val log4jPlugins = sourceSets.create("log4jPlugins") {
|
2026-07-17 21:04:02 +08:00
|
|
|
@@ -134,7 +_,14 @@
|
2026-07-09 00:03:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
- implementation(project(":folia-api"))
|
2026-07-14 13:29:52 +08:00
|
|
|
+ implementation(project(":shiroha-api"))
|
|
|
|
|
+ // Shiroha start - dependencies
|
2026-07-22 01:14:55 +08:00
|
|
|
+ implementation("com.electronwill.night-config:toml:3.8.4")
|
2026-07-09 00:03:09 +08:00
|
|
|
+ implementation("net.openhft:affinity:3.23.3")
|
|
|
|
|
+ implementation("com.github.luben:zstd-jni:1.5.4-1")
|
|
|
|
|
+ implementation("net.openhft:zero-allocation-hashing:0.16")
|
|
|
|
|
+ implementation("net.objecthunter:exp4j:0.4.8")
|
2026-07-14 13:29:52 +08:00
|
|
|
+ // Shiroha end
|
2026-07-14 18:38:33 +08:00
|
|
|
implementation("ca.spottedleaf:leafpile:1.0.0")
|
2026-07-09 00:03:09 +08:00
|
|
|
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
|
|
|
|
|
@@ -189,21 +_,21 @@
|
|
|
|
|
val git = Git(rootProject.layout.projectDirectory.path)
|
|
|
|
|
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
|
|
|
|
val build = System.getenv("BUILD_NUMBER") ?: null
|
|
|
|
|
- val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
|
|
|
|
|
+ val buildTime = Instant.now()
|
|
|
|
|
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",
|
2026-07-14 13:29:52 +08:00
|
|
|
+ "Implementation-Title" to "Shiroha",
|
2026-07-09 00:03:09 +08:00
|
|
|
"Implementation-Version" to implementationVersion,
|
|
|
|
|
"Implementation-Vendor" to date,
|
|
|
|
|
- "Specification-Title" to "Folia",
|
2026-07-14 13:29:52 +08:00
|
|
|
+ "Specification-Title" to "Shiroha",
|
2026-07-09 00:03:09 +08:00
|
|
|
"Specification-Version" to project.version,
|
|
|
|
|
- "Specification-Vendor" to "Paper Team",
|
|
|
|
|
- "Brand-Id" to "papermc:folia",
|
|
|
|
|
- "Brand-Name" to "Folia",
|
2026-08-11 15:18:51 +08:00
|
|
|
+ "Specification-Vendor" to "EilsapMC",
|
|
|
|
|
+ "Brand-Id" to "eilsapmc:shiroha",
|
2026-07-14 13:29:52 +08:00
|
|
|
+ "Brand-Name" to "Shiroha",
|
2026-07-09 00:03:09 +08:00
|
|
|
"Build-Number" to (build ?: ""),
|
|
|
|
|
"Build-Time" to buildTime.toString(),
|
|
|
|
|
"Git-Branch" to gitBranch,
|
2026-08-08 11:46:48 +08:00
|
|
|
@@ -352,7 +_,7 @@
|
2026-07-09 00:03:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fill {
|
|
|
|
|
- project("folia")
|
2026-07-14 13:29:52 +08:00
|
|
|
+ project("shiroha")
|
2026-07-09 00:03:09 +08:00
|
|
|
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
|
|
|
|
version(paperweight.minecraftVersion)
|
|
|
|
|
|
2026-08-11 15:18:51 +08:00
|
|
|
@@ -366,4 +_,15 @@
|
2026-07-09 00:03:09 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+tasks.withType<JavaCompile> {
|
|
|
|
|
+ val compilerArgs = options.compilerArgs
|
|
|
|
|
+ // Pufferfish SIMD
|
|
|
|
|
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
|
|
|
|
|
+
|
|
|
|
|
+ // Disable compiler warns
|
|
|
|
|
+ compilerArgs.add("-Xlint:-module")
|
|
|
|
|
+ compilerArgs.add("-Xlint:-removal")
|
|
|
|
|
+ compilerArgs.add("-Xlint:-dep-ann")
|
|
|
|
|
}
|