Skip to content

Commit

Permalink
Dynamic commands, yay :DD
Browse files Browse the repository at this point in the history
  • Loading branch information
DSH105 committed Mar 7, 2014
1 parent 8392f26 commit 60c66e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/main/java/com/dsh105/holoapi/HoloAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/dsh105/holoapi/config/ConfigOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public ConfigOptions(YAMLConfig config) {

@Override
public void setDefaults() {
set("command", "holo");

set("primaryChatColour", "3");
set("secondaryChatColour", "b");

Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60c66e3

Please sign in to comment.