apply the rest of the unapplied patches

This commit is contained in:
granny
2024-06-17 20:04:21 -07:00
parent 04a9fec0cc
commit 45774b4d0e
206 changed files with 885 additions and 928 deletions

View File

@@ -0,0 +1,47 @@
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 13c084e250f298b2181abebe2c391dc172c0d49f..c6fe1a3760d620bd95a918d7b37d284d7161621c 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -221,8 +221,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
RaidCommand.register(this.dispatcher, commandRegistryAccess);
DebugPathCommand.register(this.dispatcher);
DebugMobSpawningCommand.register(this.dispatcher);
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 824afdc486a50952bf5e32b06509f7952da9bba5..abb60e5cf3ecdb40561510dc53294e3010fbe039 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -122,6 +122,7 @@ public class Main {
// Purpur start - load config files early
org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionset.valueOf("purpur-settings"));
org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels");
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands");
// Purpur end - load config files early
io.papermc.paper.plugin.PluginInitializerManager.load(optionset); // Paper
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 8c1b21f6bfb6d92cdd461c8ef7b2dd98b8f7db40..7e1ffdf66be384e68c2ab005a1b439609e4a1a13 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -576,4 +576,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);
+ }
}