diff --git a/src/main/java/com/dsh105/holoapi/HoloAPI.java b/src/main/java/com/dsh105/holoapi/HoloAPI.java index 96d5acea..eb0f555e 100644 --- a/src/main/java/com/dsh105/holoapi/HoloAPI.java +++ b/src/main/java/com/dsh105/holoapi/HoloAPI.java @@ -8,6 +8,8 @@ import com.dsh105.dshutils.logger.Logger; import com.dsh105.holoapi.api.HoloManager; import com.dsh105.holoapi.api.SimpleHoloManager; +import com.dsh105.holoapi.command.CommandManager; +import com.dsh105.holoapi.command.DynamicPluginCommand; import com.dsh105.holoapi.command.HoloCommand; import com.dsh105.holoapi.config.ConfigOptions; import com.dsh105.holoapi.image.*; @@ -29,6 +31,7 @@ public class HoloAPI extends DSHPlugin { + private static CommandManager COMMAND_MANAGER; private static SimpleHoloManager MANAGER; private static SimpleImageLoader IMAGE_LOADER; private static SimpleAnimationLoader ANIMATION_LOADER; @@ -116,7 +119,12 @@ public void onEnable() { MANAGER = new SimpleHoloManager(); IMAGE_LOADER = new SimpleImageLoader(); ANIMATION_LOADER = new SimpleAnimationLoader(); - this.getCommand("holo").setExecutor(new HoloCommand()); + + COMMAND_MANAGER = new CommandManager(this); + DynamicPluginCommand holoCommand = new DynamicPluginCommand(this.getCommandLabel(), new String[0], "Create, remove and view information on Holographic displays", "Use &b/" + HoloAPI.getInstance().getCommandLabel() + " help &3for help.", new HoloCommand(), null, this); + holoCommand.setPermission("holoapi.holo"); + COMMAND_MANAGER.register(holoCommand); + manager.registerEvents(new HoloListener(), this); this.loadHolograms(this); diff --git a/src/main/java/com/dsh105/holoapi/config/ConfigOptions.java b/src/main/java/com/dsh105/holoapi/config/ConfigOptions.java index 4a9c90aa..df7974b7 100644 --- a/src/main/java/com/dsh105/holoapi/config/ConfigOptions.java +++ b/src/main/java/com/dsh105/holoapi/config/ConfigOptions.java @@ -13,6 +13,8 @@ public ConfigOptions(YAMLConfig config) { @Override public void setDefaults() { + set("command", "holo"); + set("primaryChatColour", "3"); set("secondaryChatColour", "b"); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 45c9dafc..3a23b8ba 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -5,9 +5,6 @@ description: Advanced Hologram management website: ${project.url} main: ${main.class} commands: - holo: - description: Create, remove and view information on Holographic displays - permission: holoapi.holo holoupdate: description: Update the HoloAPI plugin permission: holoapi.update