mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
42 lines
2.1 KiB
Diff
42 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
|
|
Date: Wed, 12 Oct 2022 10:42:15 -0400
|
|
Subject: [PATCH] Leaf config
|
|
|
|
Leaf Config v3
|
|
including load config, backup old or outdated config, and add config to spark profiler automatically.
|
|
|
|
TODO - Dreeam:
|
|
Add per world config
|
|
Add config reload
|
|
|
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
|
index 58be6e1d1607a3af5e28f851718b82321f2feb25..a5aa3d415486ef262383ab738eb7dd80b3fecb5e 100644
|
|
--- a/net/minecraft/server/Main.java
|
|
+++ b/net/minecraft/server/Main.java
|
|
@@ -108,10 +108,12 @@ public class Main {
|
|
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
|
}
|
|
|
|
+ org.dreeam.leaf.config.LeafConfig.loadConfig(); // Leaf - Leaf config
|
|
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
|
|
Bootstrap.bootStrap();
|
|
Bootstrap.validate();
|
|
Util.startTimerHackThread();
|
|
+ org.dreeam.leaf.config.ConfigModules.loadAfterBootstrap(); // Leaf - Leaf config - post load
|
|
Path path1 = Paths.get("server.properties");
|
|
DedicatedServerSettings dedicatedServerSettings = new DedicatedServerSettings(optionSet); // CraftBukkit - CLI argument support
|
|
dedicatedServerSettings.forceSave();
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
index 5bb1b96390671fb4eb59a8d795a97e8fb061cc0d..ba5962b04a61e21ae81c2c212de6945585981ddd 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -1102,6 +1102,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
org.spigotmc.WatchdogThread.tick();
|
|
// Paper end
|
|
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
|
+ org.dreeam.leaf.config.LeafConfig.regSparkExtraConfig(); // Leaf - Leaf config
|
|
Arrays.fill(this.recentTps, 20);
|
|
// Paper start - further improve server tick loop
|
|
long tickSection = Util.getNanos();
|