mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
51 lines
3.2 KiB
Diff
51 lines
3.2 KiB
Diff
From 10208bcef5c949e133092f588296ebb6e22f36d8 Mon Sep 17 00:00:00 2001
|
|
From: File <noreply+automated@papermc.io>
|
|
Date: Sun, 20 Apr 1997 06:37:42 -0700
|
|
Subject: [PATCH] purpur File Patches
|
|
|
|
|
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
|
index 1927163db5d44383b69f41e4b9855535e853d127..603feb73bb5b45eec5984d27d0f5cf98ccc8420c 100644
|
|
--- a/net/minecraft/commands/Commands.java
|
|
+++ b/net/minecraft/commands/Commands.java
|
|
@@ -222,7 +222,7 @@ public class Commands {
|
|
JfrCommand.register(this.dispatcher);
|
|
}
|
|
|
|
- if (SharedConstants.IS_RUNNING_IN_IDE) {
|
|
+ if (org.purpurmc.purpur.PurpurConfig.registerMinecraftDebugCommands || SharedConstants.IS_RUNNING_IN_IDE) { // Purpur - register minecraft debug commands
|
|
RaidCommand.register(this.dispatcher, context);
|
|
DebugPathCommand.register(this.dispatcher);
|
|
DebugMobSpawningCommand.register(this.dispatcher);
|
|
@@ -250,6 +250,14 @@ public class Commands {
|
|
StopCommand.register(this.dispatcher);
|
|
TransferCommand.register(this.dispatcher);
|
|
WhitelistCommand.register(this.dispatcher);
|
|
+ org.purpurmc.purpur.command.CreditsCommand.register(this.dispatcher); // Purpur - Add credits command
|
|
+ org.purpurmc.purpur.command.DemoCommand.register(this.dispatcher); // Purpur - Add demo command
|
|
+ org.purpurmc.purpur.command.PingCommand.register(this.dispatcher); // Purpur - Add ping command
|
|
+ org.purpurmc.purpur.command.UptimeCommand.register(this.dispatcher); // Purpur - Add uptime command
|
|
+ org.purpurmc.purpur.command.TPSBarCommand.register(this.dispatcher); // Purpur - Implement TPSBar
|
|
+ org.purpurmc.purpur.command.CompassCommand.register(this.dispatcher); // Purpur - Add compass command
|
|
+ org.purpurmc.purpur.command.RamBarCommand.register(this.dispatcher); // Purpur - Add rambar command
|
|
+ org.purpurmc.purpur.command.RamCommand.register(this.dispatcher); // Purpur - Add ram command
|
|
}
|
|
|
|
if (selection.includeIntegrated) {
|
|
@@ -502,6 +510,7 @@ public class Commands {
|
|
private void runSync(ServerPlayer player, java.util.Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootCommandNode) {
|
|
// Paper end - Perf: Async command map building
|
|
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootCommandNode, true).callEvent(); // Paper - Brigadier API
|
|
+ if (org.bukkit.event.player.PlayerCommandSendEvent.getHandlerList().getRegisteredListeners().length > 0) { // Purpur - Skip events if there's no listeners
|
|
org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit));
|
|
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
|
|
|
@@ -512,6 +521,7 @@ public class Commands {
|
|
}
|
|
}
|
|
// CraftBukkit end
|
|
+ } // Purpur - Skip events if there's no listeners
|
|
|
|
player.connection.send(new ClientboundCommandsPacket(rootCommandNode));
|
|
}
|