fix(bukkit): only update commands if the method exists
This commit is contained in:
parent
de22d70669
commit
2dfbefdd7a
1 changed files with 4 additions and 2 deletions
|
|
@ -165,9 +165,11 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
|
|||
|
||||
this.registeredCommands.remove(rootCommand);
|
||||
|
||||
if (this.bukkitCommandManager.hasCapability(CloudBukkitCapabilities.BRIGADIER)) {
|
||||
// Once the command has been unregistered, we need to refresh the command list for all online players.
|
||||
Bukkit.getOnlinePlayers().forEach(Player::updateCommands);
|
||||
}
|
||||
}
|
||||
|
||||
private @NonNull String getNamespacedLabel(final @NonNull String label) {
|
||||
return String.format("%s:%s", this.bukkitCommandManager.getOwningPlugin().getName(), label).toLowerCase();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue