fix: Do not tab complete if command not owned by FAWE (#2386)

This commit is contained in:
Jeff P 2023-08-02 08:08:58 -04:00 committed by GitHub
parent a6f1c6ac82
commit 50e45f07f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -672,6 +672,13 @@ public class WorldEditPlugin extends JavaPlugin {
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);