From 220ce160beab0e5eb52451ca707f4c0fe4960348 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Wed, 4 Dec 2024 20:26:38 +0000 Subject: [PATCH] Allow running client commands from chat components (#554) --- .../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 dab1a825b8..e7245ea6e2 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_)); +@@ -2565,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; @@ -2640,6 +_,10 @@ public Scoreboard scoreboard() {