From f12bc17ca3423dcf13f88b49c97558aa94e1d94e Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 23 Jun 2018 16:32:53 -0700 Subject: [PATCH] Removed code duplication in Composite Command constructor --- .../api/commands/CompositeCommand.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java b/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java index fb47c768d..576fa23f2 100644 --- a/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java +++ b/src/main/java/us/tastybento/bskyblock/api/commands/CompositeCommand.java @@ -122,24 +122,8 @@ public abstract class CompositeCommand extends Command implements PluginIdentifi * @param aliases - aliases */ public CompositeCommand(Addon addon, String label, String... aliases) { - super(label); - this.topLabel = label; + this(label, aliases); this.addon = addon; - this.plugin = BSkyBlock.getInstance(); - setAliases(new ArrayList<>(Arrays.asList(aliases))); - parent = null; - setUsage(""); - subCommandLevel = 0; // Top level - subCommands = new LinkedHashMap<>(); - subCommandAliases = new LinkedHashMap<>(); - // Register command if it is not already registered - if (plugin.getCommand(label) == null) { - plugin.getCommandsManager().registerCommand(this); - } - setup(); - if (!getSubCommand("help").isPresent() && !label.equals("help")) { - new DefaultHelpCommand(this); - } } /**