mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
all patches applied \o/
This commit is contained in:
50
patches/server/0294-register-minecraft-debug-commands.patch
Normal file
50
patches/server/0294-register-minecraft-debug-commands.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: granny <contact@granny.dev>
|
||||
Date: Sun, 18 Feb 2024 16:28:32 -0800
|
||||
Subject: [PATCH] register minecraft debug commands
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index 13dfb3e506d50c0b191baf5d05bbfc28c20be0ae..f9d0e8ee9414b3897f268ba78a1469ddf868f51a 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -222,8 +222,8 @@ public class Commands {
|
||||
JfrCommand.register(this.dispatcher);
|
||||
}
|
||||
|
||||
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
||||
- TestCommand.register(this.dispatcher);
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands || SharedConstants.IS_RUNNING_IN_IDE) { // Purpur
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands) TestCommand.register(this.dispatcher); // Purpur
|
||||
ResetChunksCommand.register(this.dispatcher);
|
||||
RaidCommand.register(this.dispatcher, commandRegistryAccess);
|
||||
DebugPathCommand.register(this.dispatcher);
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 5443013060b62e3bfcc51cddca96d1c0bc59fe72..868932a170c3052e49dc69c2e8eb3ac9c405b45f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -133,6 +133,10 @@ public class Main {
|
||||
// Paper start - load config files early for access below if needed
|
||||
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"));
|
||||
+ // 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
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index ecb9b15939ab8ff6cfa7e15457701428019b443a..ea383b56c5985069fb55e5a2252510e45783df7a 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -571,4 +571,9 @@ public class PurpurConfig {
|
||||
private static void playerDeathsAlwaysShowItem() {
|
||||
playerDeathsAlwaysShowItem = getBoolean("settings.player-deaths-always-show-item", playerDeathsAlwaysShowItem);
|
||||
}
|
||||
+
|
||||
+ public static boolean registerMinecraftDebugCommands = false;
|
||||
+ private static void registerMinecraftDebugCommands() {
|
||||
+ registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
|
||||
+ }
|
||||
}
|
||||
Reference in New Issue
Block a user