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,8 +165,10 @@ public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHa
this.registeredCommands.remove(rootCommand); this.registeredCommands.remove(rootCommand);
// Once the command has been unregistered, we need to refresh the command list for all online players. if (this.bukkitCommandManager.hasCapability(CloudBukkitCapabilities.BRIGADIER)) {
Bukkit.getOnlinePlayers().forEach(Player::updateCommands); // 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) { private @NonNull String getNamespacedLabel(final @NonNull String label) {