Add support for "/chase", a disabled Minecraft command. (#1690)

Co-authored-by: granny <granny@purpurmc.org>
This commit is contained in:
Mickey42302
2025-07-11 00:53:58 -04:00
committed by GitHub
parent 4d5a8e6ebd
commit 7dbe41536b
3 changed files with 20 additions and 1 deletions

View File

@@ -9,6 +9,19 @@
RaidCommand.register(this.dispatcher, context);
DebugPathCommand.register(this.dispatcher);
DebugMobSpawningCommand.register(this.dispatcher);
@@ -264,6 +_,12 @@
}
}
+ // Purpur start - register disabled minecraft commands
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDisabledCommands) {
+ net.minecraft.server.commands.ChaseCommand.register(this.dispatcher);
+ }
+ // Purpur end - register disabled minecraft commands
+
if (selection.includeDedicated) {
BanIpCommands.register(this.dispatcher);
BanListCommands.register(this.dispatcher);
@@ -280,6 +_,14 @@
StopCommand.register(this.dispatcher);
TransferCommand.register(this.dispatcher);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
@@ -109,6 +_,12 @@
@@ -109,6 +_,13 @@
JvmProfiler.INSTANCE.start(Environment.SERVER);
}
@@ -8,6 +8,7 @@
+ 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", true);
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands"); // Purpur - register minecraft debug commands
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDisabledCommands = purpurConfiguration.getBoolean("settings.register-minecraft-disabled-commands"); // Purpur - register disabled minecraft commands
+ // Purpur end - Add toggle for enchant level clamping - load config files early
+
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper

View File

@@ -599,6 +599,11 @@ public class PurpurConfig {
registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
}
public static boolean registerMinecraftDisabledCommands = false;
private static void registerMinecraftDisabledCommands() {
registerMinecraftDisabledCommands = getBoolean("settings.register-minecraft-disabled-commands", registerMinecraftDebugCommands);
}
public static List<String> startupCommands = new ArrayList<>();
private static void startupCommands() {
startupCommands.clear();