diff --git a/src/main/java/net/elytrium/velocitytools/VelocityTools.java b/src/main/java/net/elytrium/velocitytools/VelocityTools.java index 703f9e6..b9171ce 100644 --- a/src/main/java/net/elytrium/velocitytools/VelocityTools.java +++ b/src/main/java/net/elytrium/velocitytools/VelocityTools.java @@ -138,28 +138,27 @@ public void reload() { } List aliases = Settings.IMP.COMMANDS.HUB.ALIASES; - aliases.forEach(alias -> this.server.getCommandManager().unregister(alias)); if (Settings.IMP.COMMANDS.HUB.ENABLED && !aliases.isEmpty()) { + aliases.forEach(alias -> this.server.getCommandManager().unregister(alias)); this.server.getCommandManager().register(aliases.get(0), new HubCommand(this.server), aliases.toArray(new String[0])); } - this.server.getCommandManager().unregister("alert"); - this.server.getCommandManager().unregister("find"); - this.server.getCommandManager().unregister("send"); - this.server.getCommandManager().unregister("velocitytools"); - if (Settings.IMP.COMMANDS.ALERT.ENABLED) { + this.server.getCommandManager().unregister("alert"); this.server.getCommandManager().register("alert", new AlertCommand(this.server)); } if (Settings.IMP.COMMANDS.FIND.ENABLED) { + this.server.getCommandManager().unregister("find"); this.server.getCommandManager().register("find", new FindCommand(this.server)); } if (Settings.IMP.COMMANDS.SEND.ENABLED) { + this.server.getCommandManager().unregister("send"); this.server.getCommandManager().register("send", new SendCommand(this.server)); } + this.server.getCommandManager().unregister("velocitytools"); this.server.getCommandManager().register("velocitytools", new VelocityToolsCommand(this), "vtools"); this.server.getEventManager().unregisterListeners(this);