fix(bukkit): only update commands if the method exists

This commit is contained in:
Citymonstret 2022-06-12 10:50:37 +02:00 committed by Jason
parent de22d70669
commit 2dfbefdd7a

View file

@ -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();