From 55d84c29d6950bc7e990f079987c19e13ed13884 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Thu, 24 Oct 2024 21:35:29 +0100 Subject: [PATCH] Allow running client commands from chat components --- .../client/multiplayer/ClientPacketListener.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch b/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch index a1ad4df3f6..a2bb6e2bf2 100644 --- a/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch +++ b/patches/net/minecraft/client/multiplayer/ClientPacketListener.java.patch @@ -143,6 +143,15 @@ SignableCommand signablecommand = SignableCommand.of(this.parseCommand(p_250092_)); if (signablecommand.arguments().isEmpty()) { this.send(new ServerboundChatCommandPacket(p_250092_)); +@@ -2551,6 +_,8 @@ + } + + public boolean sendUnsignedCommand(String p_251509_) { ++ // Neo: Dispatch client commands for text component click actions. ++ if (net.neoforged.neoforge.client.ClientCommandHandler.runCommand(p_251509_)) return true; + if (!SignableCommand.hasSignableArguments(this.parseCommand(p_251509_))) { + this.send(new ServerboundChatCommandPacket(p_251509_)); + return true; @@ -2622,6 +_,10 @@ public Scoreboard scoreboard() {