Skip to content

Commit

Permalink
feat: fix some errors, and update CommandAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed Dec 27, 2024
1 parent f9c68cf commit 2e29505
Show file tree
Hide file tree
Showing 19 changed files with 1,759 additions and 1,030 deletions.
19 changes: 6 additions & 13 deletions patches/server/0001-Rebrand-to-Lumina-and-build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Rebrand to Lumina and build changes


diff --git a/build.gradle.kts b/build.gradle.kts
index 8d2b5fec6fe27dca3ce01ba1ce50506179fc3b4d..619becf5c3f4f25661d9db090df21bd83dd5e0f3 100644
index 8d2b5fec6fe27dca3ce01ba1ce50506179fc3b4d..2c26932456401bebe45780527e3408cc939955a9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,7 +25,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
Expand All @@ -17,26 +17,19 @@ index 8d2b5fec6fe27dca3ce01ba1ce50506179fc3b4d..619becf5c3f4f25661d9db090df21bd8
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
// Paper start
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
@@ -44,9 +44,18 @@ dependencies {
alsoShade(log4jPlugins.output)
implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
// Paper end
+ // LinearPaper start - Linear format
+ implementation("com.github.luben:zstd-jni:1.5.6-3")
+ implementation("org.lz4:lz4-java:1.8.0")
+ // LinearPaper end
@@ -47,6 +47,11 @@ dependencies {
implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.7.1")
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
+ implementation("org.spongepowered:configurate-hocon:4.2.0-SNAPSHOT") // Lumina - config files
+ // Lumina start - Command API
+ compileOnly("dev.jorel:commandapi-preprocessor:9.5.3")
+ implementation("dev.jorel:commandapi-bukkit-core:9.5.3")
+ compileOnly("dev.jorel:commandapi-preprocessor:9.7.0")
+ implementation("dev.jorel:commandapi-bukkit-core:9.7.0")
+ // Lumina end - Command API
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.47.0.0")
runtimeOnly("com.mysql:mysql-connector-j:9.1.0")
@@ -100,14 +109,14 @@ tasks.jar {
@@ -100,14 +105,14 @@ tasks.jar {
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
Expand All @@ -55,7 +48,7 @@ index 8d2b5fec6fe27dca3ce01ba1ce50506179fc3b4d..619becf5c3f4f25661d9db090df21bd8
"Build-Number" to (build ?: ""),
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper
@@ -237,18 +246,27 @@ tasks.registerRunTask("runBundler") {
@@ -237,18 +242,27 @@ tasks.registerRunTask("runBundler") {
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip })
mainClass.set(null as String?)
}
Expand Down
405 changes: 194 additions & 211 deletions patches/server/0004-Command-API-support.patch

Large diffs are not rendered by default.

31 changes: 26 additions & 5 deletions patches/server/0005-Lumina-server-config-and-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3285,20 +3285,41 @@ index 0000000000000000000000000000000000000000..b043bf36de0604028cb7bdd166d000d2
+}
diff --git a/src/main/java/org/leavesmc/lumina/config/modules/misc/RegionFormatConfig.java b/src/main/java/org/leavesmc/lumina/config/modules/misc/RegionFormatConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..35aed045ceb1f7647de4b0efbf7c609f62c402d8
index 0000000000000000000000000000000000000000..a77ee98609c33e47a36ceb28628bd3ffd49f7614
--- /dev/null
+++ b/src/main/java/org/leavesmc/lumina/config/modules/misc/RegionFormatConfig.java
@@ -0,0 +1,11 @@
@@ -0,0 +1,32 @@
+package org.leavesmc.lumina.config.modules.misc;
+
+import abomination.LinearRegionFile;
+import me.earthme.luminol.utils.EnumRegionFormat;
+import net.minecraft.server.MinecraftServer;
+import org.spongepowered.configurate.objectmapping.ConfigSerializable;
+import org.stupidcraft.linearpaper.region.EnumRegionFileExtension;
+import org.spongepowered.configurate.objectmapping.meta.PostProcess;
+
+@ConfigSerializable
+public class RegionFormatConfig {
+ public EnumRegionFileExtension format = EnumRegionFileExtension.MCA;
+ public EnumRegionFormat regionFormat;
+ public int linearCompressionLevel = 1;
+ public int linearFlushFrequency = 10;
+ public int linearIoThreadCount = 6;
+ public int linearIoFlushDelayMs = 100;
+ public boolean linearUseVirtualThread = true;
+
+
+ @PostProcess
+ public void postProcess() {
+ if (regionFormat == EnumRegionFormat.LINEAR_V2) {
+ if (linearCompressionLevel > 23 || linearCompressionLevel < 1) {
+ MinecraftServer.LOGGER.error("Linear region compression level should be between 1 and 22 in config: {}", linearCompressionLevel);
+ MinecraftServer.LOGGER.error("Falling back to compression level 1.");
+ linearCompressionLevel = 1;
+ }
+
+ LinearRegionFile.SAVE_DELAY_MS = linearIoFlushDelayMs;
+ LinearRegionFile.SAVE_THREAD_MAX_COUNT = linearIoThreadCount;
+ LinearRegionFile.USE_VIRTUAL_THREAD = linearUseVirtualThread;
+ }
+ }
+}
diff --git a/src/main/java/org/leavesmc/lumina/config/modules/misc/WatchdogConfig.java b/src/main/java/org/leavesmc/lumina/config/modules/misc/WatchdogConfig.java
new file mode 100644
Expand Down
Loading

0 comments on commit 2e29505

Please sign in to comment.