Skip to content

Commit

Permalink
fix: Ignore proxy commands executed by plugins
Browse files Browse the repository at this point in the history
These executions are never transmitted to the backend server and can cause bugs
  • Loading branch information
4drian3d committed Jan 25, 2025
1 parent 0096764 commit b2ef4f7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ public void register() {
@Override
public @Nullable EventTask executeAsync(final CommandExecuteEvent event) {
final CommandExecuteEvent.CommandResult result = event.getResult();
// A plugin command invocation, like CommandManager#executeAsync(CommandSource, String)
if (event.getInvocationInfo().source() == CommandExecuteEvent.Source.API) {
return null;
}

// A non-player command invocation
if (!(event.getCommandSource() instanceof Player player)) return null;
return EventTask.withContinuation(continuation -> {
final ServerConnection server = player.getCurrentServer().orElse(null);
Expand Down

0 comments on commit b2ef4f7

Please sign in to comment.