9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/paper-patches/features/0003-Leaves-Server-Config.patch
2025-11-28 00:33:38 +08:00

51 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sat, 1 Feb 2025 14:21:06 +0800
Subject: [PATCH] Leaves Server Config
diff --git a/src/main/java/io/papermc/paper/SparksFly.java b/src/main/java/io/papermc/paper/SparksFly.java
index 62e2d5704c348955bc8284dc2d54c933b7bcdd06..7ef20f0138fad39a1d23edd7b26ddc8816427ec8 100644
--- a/src/main/java/io/papermc/paper/SparksFly.java
+++ b/src/main/java/io/papermc/paper/SparksFly.java
@@ -42,7 +42,7 @@ public final class SparksFly {
this.mainThreadTaskQueue = new ConcurrentLinkedQueue<>();
this.logger = Logger.getLogger(ID);
this.logger.log(Level.INFO, "This server bundles the spark profiler. For more information please visit https://docs.papermc.io/paper/profiling");
- this.spark = PaperSparkModule.create(Compatibility.VERSION_1_0, server, this.logger, new PaperScheduler() {
+ this.spark = org.leavesmc.leaves.spark.LeavesSparkPlugin.create(Compatibility.VERSION_1_0, server, this.logger, new PaperScheduler() { // Leaves - make leaves
@Override
public void executeAsync(final Runnable runnable) {
MCUtil.scheduleAsyncTask(this.catching(runnable, "asynchronous"));
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 34d74014fd042f6eeafafadb6237a838b1ddd47c..01672aff7c4028da9714448bb3386b7d8369db59 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1020,6 +1020,7 @@ public final class CraftServer implements Server {
playerMetadata.removeAll(plugin);
}
// Paper end
+ org.leavesmc.leaves.LeavesConfig.reload(); // Leaves - Server Config
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 26b30fac9a12c88b3e8ed114a9225f57603b937e..0aa959d64b34446d29961684eb050db336c79dfe 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -169,6 +169,14 @@ public class Main {
.ofType(String.class)
.defaultsTo("Unknown Server")
.describedAs("Name");
+
+ // Leaves start - Server Config
+ acceptsAll(asList("leaves", "leaves-settings"), "File for leaves settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("leaves.yml"))
+ .describedAs("Yml file");
+ // Leaves end - Server Config
}
};