Skip to content

Commit

Permalink
Allow running client commands from chat components
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Oct 24, 2024
1 parent 3f10254 commit 55d84c2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@
SignableCommand<SharedSuggestionProvider> 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() {
Expand Down

0 comments on commit 55d84c2

Please sign in to comment.