Skip to content

Commit 7dbe415

Browse files
Mickey42302granny
andauthored
Add support for "/chase", a disabled Minecraft command. (#1690)
Co-authored-by: granny <granny@purpurmc.org>
1 parent 4d5a8e6 commit 7dbe415

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

purpur-server/minecraft-patches/sources/net/minecraft/commands/Commands.java.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
RaidCommand.register(this.dispatcher, context);
1010
DebugPathCommand.register(this.dispatcher);
1111
DebugMobSpawningCommand.register(this.dispatcher);
12+
@@ -264,6 +_,12 @@
13+
}
14+
}
15+
16+
+ // Purpur start - register disabled minecraft commands
17+
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDisabledCommands) {
18+
+ net.minecraft.server.commands.ChaseCommand.register(this.dispatcher);
19+
+ }
20+
+ // Purpur end - register disabled minecraft commands
21+
+
22+
if (selection.includeDedicated) {
23+
BanIpCommands.register(this.dispatcher);
24+
BanListCommands.register(this.dispatcher);
1225
@@ -280,6 +_,14 @@
1326
StopCommand.register(this.dispatcher);
1427
TransferCommand.register(this.dispatcher);

purpur-server/minecraft-patches/sources/net/minecraft/server/Main.java.patch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
--- a/net/minecraft/server/Main.java
22
+++ b/net/minecraft/server/Main.java
3-
@@ -109,6 +_,12 @@
3+
@@ -109,6 +_,13 @@
44
JvmProfiler.INSTANCE.start(Environment.SERVER);
55
}
66

77
+ // Purpur start - Add toggle for enchant level clamping - load config files early
88
+ org.bukkit.configuration.file.YamlConfiguration purpurConfiguration = io.papermc.paper.configuration.PaperConfigurations.loadLegacyConfigFile((File) optionSet.valueOf("purpur-settings"));
99
+ org.purpurmc.purpur.PurpurConfig.clampEnchantLevels = purpurConfiguration.getBoolean("settings.enchantment.clamp-levels", true);
1010
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands = purpurConfiguration.getBoolean("settings.register-minecraft-debug-commands"); // Purpur - register minecraft debug commands
11+
+ org.purpurmc.purpur.PurpurConfig.registerMinecraftDisabledCommands = purpurConfiguration.getBoolean("settings.register-minecraft-disabled-commands"); // Purpur - register disabled minecraft commands
1112
+ // Purpur end - Add toggle for enchant level clamping - load config files early
1213
+
1314
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper

purpur-server/src/main/java/org/purpurmc/purpur/PurpurConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,11 @@ private static void registerMinecraftDebugCommands() {
599599
registerMinecraftDebugCommands = getBoolean("settings.register-minecraft-debug-commands", registerMinecraftDebugCommands);
600600
}
601601

602+
public static boolean registerMinecraftDisabledCommands = false;
603+
private static void registerMinecraftDisabledCommands() {
604+
registerMinecraftDisabledCommands = getBoolean("settings.register-minecraft-disabled-commands", registerMinecraftDebugCommands);
605+
}
606+
602607
public static List<String> startupCommands = new ArrayList<>();
603608
private static void startupCommands() {
604609
startupCommands.clear();

0 commit comments

Comments
 (0)