From 2dfbefdd7ac9483084c4f30e76e663242f95437e Mon Sep 17 00:00:00 2001 From: Citymonstret Date: Sun, 12 Jun 2022 10:50:37 +0200 Subject: [PATCH] fix(bukkit): only update commands if the method exists --- .../bukkit/BukkitPluginRegistrationHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java index 08143edb..d3ff4302 100644 --- a/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java +++ b/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitPluginRegistrationHandler.java @@ -165,8 +165,10 @@ public class BukkitPluginRegistrationHandler implements CommandRegistrationHa this.registeredCommands.remove(rootCommand); - // Once the command has been unregistered, we need to refresh the command list for all online players. - Bukkit.getOnlinePlayers().forEach(Player::updateCommands); + 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) {