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

Dieser Commit ist enthalten in:
Jeff P 2023-08-02 08:08:58 -04:00 committet von GitHub
Ursprung a6f1c6ac82
Commit 50e45f07f0
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -672,6 +672,13 @@ public class WorldEditPlugin extends JavaPlugin {
String label = buffer.substring(0, firstSpace); String label = buffer.substring(0, firstSpace);
// Strip leading slash, if present. // Strip leading slash, if present.
label = label.startsWith("/") ? label.substring(1) : label; 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 final Optional<org.enginehub.piston.Command> command
= WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().getCommand( = WorldEdit.getInstance().getPlatformManager().getPlatformCommandManager().getCommandManager().getCommand(
label); label);