diff --git a/bukkit/src/main/java/com/discordsrv/bukkit/BukkitDiscordSRV.java b/bukkit/src/main/java/com/discordsrv/bukkit/BukkitDiscordSRV.java index 087ee583..c1c1a3cd 100644 --- a/bukkit/src/main/java/com/discordsrv/bukkit/BukkitDiscordSRV.java +++ b/bukkit/src/main/java/com/discordsrv/bukkit/BukkitDiscordSRV.java @@ -179,12 +179,6 @@ public class BukkitDiscordSRV extends ServerDiscordSRV { + PluginCommand pluginCommand = command(command); + if (pluginCommand == null) { + logger.error("Failed to create command " + command.getLabel()); + return; + } - logger.debug("Registering command " + command.getLabel() + " with basic handler"); + logger.debug("Registering command " + command.getLabel() + " with basic handler"); - handler.registerCommand(command); - pluginCommand.setExecutor(this); - pluginCommand.setTabCompleter(this); + handler.registerCommand(command); + pluginCommand.setExecutor(this); + pluginCommand.setTabCompleter(this); + }); } } diff --git a/bukkit/src/main/java/com/discordsrv/bukkit/command/game/handler/CommodoreHandler.java b/bukkit/src/main/java/com/discordsrv/bukkit/command/game/handler/CommodoreHandler.java index a54bc6d5..b05f2b99 100644 --- a/bukkit/src/main/java/com/discordsrv/bukkit/command/game/handler/CommodoreHandler.java +++ b/bukkit/src/main/java/com/discordsrv/bukkit/command/game/handler/CommodoreHandler.java @@ -25,6 +25,7 @@ import com.discordsrv.common.command.game.sender.ICommandSender; import com.mojang.brigadier.tree.LiteralCommandNode; import me.lucko.commodore.Commodore; import me.lucko.commodore.CommodoreProvider; +import org.bukkit.command.CommandSender; import org.bukkit.command.PluginCommand; import java.util.ArrayList; @@ -43,7 +44,7 @@ public class CommodoreHandler extends AbstractBukkitCommandExecutor { public CommodoreHandler(BukkitDiscordSRV discordSRV) { super(discordSRV); this.commodore = CommodoreProvider.getCommodore(discordSRV.plugin()); - this.senderFunction = wrapper -> sender(commodore.getBukkitSender(wrapper)); + this.senderFunction = wrapper -> sender((CommandSender) wrapper); // This is probably wrong... } @Override diff --git a/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java b/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java index d6568a6c..fd87d1ed 100644 --- a/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java +++ b/common/src/main/java/com/discordsrv/common/AbstractDiscordSRV.java @@ -553,9 +553,6 @@ public abstract class AbstractDiscordSRV