Skip to content

Commit

Permalink
Continue increase leaf config load priority to fix secure feature see…
Browse files Browse the repository at this point in the history
…d not load
  • Loading branch information
Dreeam-qwq committed Apr 3, 2024
1 parent aafde43 commit 029f178
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
14 changes: 7 additions & 7 deletions patches/server/0002-Leaf-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ index 960fe37a4cf0100b552401f835900c6d8b6af523..722e9b39f03b1f41dcf9cd791324e5b6
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 96cb26fae947006ae7bceb3187ed2c28c4214f16..dc15850c30a9cafe1297629862976d58182e04f0 100644
index 96cb26fae947006ae7bceb3187ed2c28c4214f16..0e2fedea28734dfb9b748c59c54925e5ebef797f 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -142,6 +142,7 @@ public class Main {
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
// Paper end - load config files early for access below if needed
@@ -132,6 +132,7 @@ public class Main {
Bootstrap.bootStrap();
Bootstrap.validate();
Util.startTimerHackThread();
+ org.dreeam.leaf.config.LeafConfig.loadConfig(); // Leaf
Path path1 = Paths.get("server.properties");
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support

if (optionset.has("initSettings")) { // CraftBukkit
// CraftBukkit start - SPIGOT-5761: Create bukkit.yml and commands.yml if not present
diff --git a/src/main/java/org/dreeam/leaf/config/ConfigInfo.java b/src/main/java/org/dreeam/leaf/config/ConfigInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..6fbc0ad44069fbb3d85d3a6a4633e8e756196dfe
Expand Down
9 changes: 3 additions & 6 deletions patches/server/0010-Purpur-Server-Changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -730,20 +730,17 @@ index 9ec6145fe04ec64bbee8ec6a837719caebdbc6f5..358d610ad020cada1bb83e393deeeaae
public ClientboundSetTimePacket(long time, long timeOfDay, boolean doDaylightCycle) {
this.gameTime = time;
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index dc15850c30a9cafe1297629862976d58182e04f0..81e4b635de48f526498b47a6a49a9ead6685614b 100644
index 0e2fedea28734dfb9b748c59c54925e5ebef797f..33d145e1a8841f088e10332d2898931d8191b83b 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -141,8 +141,12 @@ public class Main {
// Paper start - load config files early for access below if needed
@@ -143,6 +143,10 @@ public class Main {
org.bukkit.configuration.file.YamlConfiguration bukkitConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("bukkit-settings"));
org.bukkit.configuration.file.YamlConfiguration spigotConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("spigot-settings"));
- // Paper end - load config files early for access below if needed
org.dreeam.leaf.config.LeafConfig.loadConfig(); // Leaf
// Paper end - load config files early for access below if needed
+ // Purpur start
+ org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings"));
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands");
+ // Purpur end
+ // Paper end - load config files early for access below if needed

if (optionset.has("initSettings")) { // CraftBukkit
// CraftBukkit start - SPIGOT-5761: Create bukkit.yml and commands.yml if not present
Expand Down
6 changes: 4 additions & 2 deletions patches/server/0076-Virtual-Thread-for-linear-flusher.patch
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..d4576c9930d12548d4302207f61a0eb8
+ }
+}
diff --git a/src/main/java/org/purpurmc/purpur/region/LinearRegionFileFlusher.java b/src/main/java/org/purpurmc/purpur/region/LinearRegionFileFlusher.java
index 0d3d9193e8d8f72141dc155840c5eed1a744761c..339157b5e5a81e3c1c5b54fbd9e3c53ea3f51716 100644
index 0d3d9193e8d8f72141dc155840c5eed1a744761c..dc4cf8dc6ab60b6d691e0d74d141f00d7eaf233d 100644
--- a/src/main/java/org/purpurmc/purpur/region/LinearRegionFileFlusher.java
+++ b/src/main/java/org/purpurmc/purpur/region/LinearRegionFileFlusher.java
@@ -4,9 +4,12 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
Expand All @@ -56,7 +56,7 @@ index 0d3d9193e8d8f72141dc155840c5eed1a744761c..339157b5e5a81e3c1c5b54fbd9e3c53e
import org.purpurmc.purpur.PurpurConfig;
import org.bukkit.Bukkit;

@@ -18,12 +21,28 @@ public class LinearRegionFileFlusher {
@@ -18,12 +21,30 @@ public class LinearRegionFileFlusher {
.setNameFormat("linear-flush-scheduler")
.build()
);
Expand All @@ -67,6 +67,7 @@ index 0d3d9193e8d8f72141dc155840c5eed1a744761c..339157b5e5a81e3c1c5b54fbd9e3c53e
- .build()
- );
+
+ // Leaf start - Use Virtual Thread for linear region flusher
+ private ExecutorService executor;
+
+ {
Expand All @@ -88,6 +89,7 @@ index 0d3d9193e8d8f72141dc155840c5eed1a744761c..339157b5e5a81e3c1c5b54fbd9e3c53e
+ .build());
+ }
+ }
+ // Leaf end

public LinearRegionFileFlusher() {
Bukkit.getLogger().info("Using " + PurpurConfig.linearFlushThreads + " threads for linear region flushing.");

0 comments on commit 029f178

Please sign in to comment.