Files
Shiroha/camellia-server/minecraft-patches/features/0001-Config-system-framework.patch
T

43 lines
2.7 KiB
Diff
Raw Normal View History

2026-07-09 00:03:09 +08:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Wed, 8 Jul 2026 20:49:06 +0800
Subject: [PATCH] Config system framework
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
index a4d608d64b7d3477c9144d93547fd3b4f39a1b02..8cb1cfefa0deb78c1773ba9913138f31ac1e5c92 100644
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
@@ -107,6 +107,7 @@ public class Main {
JvmProfiler.INSTANCE.start(Environment.SERVER);
}
2026-07-14 11:32:51 +08:00
+ moe.monnairealms.camellia.config.ConfigManager.initConfigs(); // Shiroha - Config system framework - pre load config file
2026-07-09 00:03:09 +08:00
io.papermc.paper.plugin.PluginInitializerManager.load(options); // Paper
Bootstrap.bootStrap();
Bootstrap.validate();
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index c6a4d52f76e10fcc57b2c49b07fbc2ef9bb90822..e305fd5850d333eb1a30572076b6475e4428f7a7 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1169,6 +1169,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ca.spottedleaf.moonrise.common.util.MoonriseCommon.haltExecutors();
}
// Paper end - rewrite chunk system
2026-07-14 11:32:51 +08:00
+ moe.monnairealms.camellia.config.ConfigManager.saveConfigs(false); // Shiroha - Config system framework - save config file
2026-07-09 00:03:09 +08:00
// Paper start - Improved watchdog support - move final shutdown items here
Util.shutdownExecutors();
this.onServerExit();
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index cd5551c0221ad2a7b5c7d452d8d91ffc9711c3ee..17244a82d7591004a43c013748f3db0507e73d7e 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -238,6 +238,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
// Paper end - initialize global and world-defaults configuration
2026-07-14 11:32:51 +08:00
+ moe.monnairealms.camellia.config.ConfigManager.loadConfigFiles(); // Shiroha - Config system framework - load config file
2026-07-09 00:03:09 +08:00
this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {