Skip to content

Commit

Permalink
fix: Do not tab complete if command not owned by FAWE (#2386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff P authored Aug 2, 2023
1 parent a6f1c6a commit 50e45f0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,13 @@ public void onAsyncTabComplete(com.destroystokyo.paper.event.server.AsyncTabComp
String label = buffer.substring(0, firstSpace);
// Strip leading slash, if present.
label = label.startsWith("/") ? label.substring(1) : label;

// If command not owned by FAWE, do not tab complete
Plugin owner = platform.getDynamicCommands().getCommandOwner(label);
if (owner != WorldEditPlugin.this) {
return;
}

final Optional<org.enginehub.piston.Command> command
= WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().getCommand(
label);
Expand Down

0 comments on commit 50e45f0

Please sign in to comment.