Skip to content

Commit

Permalink
Allow running client commands from chat components (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev authored Dec 4, 2024
1 parent 371fc84 commit 220ce16
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_));
@@ -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() {
Expand Down

0 comments on commit 220ce16

Please sign in to comment.