From e75428f7183d65ef3f509de29d20550db29f2efa Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 11 Nov 2016 14:05:57 -0500 Subject: [PATCH] Ugly change --- src/alisolarflare/DevCommand.java | 4 +++- src/alisolarflare/Module.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/alisolarflare/DevCommand.java b/src/alisolarflare/DevCommand.java index a4c5091..9a01eed 100644 --- a/src/alisolarflare/DevCommand.java +++ b/src/alisolarflare/DevCommand.java @@ -1,10 +1,11 @@ package alisolarflare; +import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import buttondevteam.lib.chat.TBMCCommandBase; -public abstract class DevCommand extends TBMCCommandBase{ +public abstract class DevCommand extends TBMCCommandBase implements CommandExecutor{ @Override public abstract boolean OnCommand(CommandSender sender, String alias, String[] args); @@ -12,6 +13,7 @@ public abstract class DevCommand extends TBMCCommandBase{ @Override public abstract String[] GetHelpText(String alias); + public abstract String GetLabel(); @Override public boolean GetPlayerOnly() { // TODO Auto-generated method stub diff --git a/src/alisolarflare/Module.java b/src/alisolarflare/Module.java index 3fe900b..c2a20f4 100644 --- a/src/alisolarflare/Module.java +++ b/src/alisolarflare/Module.java @@ -33,8 +33,8 @@ public abstract class Module{ * @param label Name of the command in plugin.yml * @param commandExecutor Custom coded CommandExecutor class */ - protected void registerCommand(JavaPlugin plugin, TBMCCommandBase commandBase){ - TBMCChatAPI.AddCommand(plugin, commandBase); + protected void registerCommand(JavaPlugin plugin, DevCommand devCommand){ + plugin.getCommand(devCommand.GetLabel()).setExecutor(devCommand); } /** * Registers a Listener to this plugin