Elytrium / VelocityTools

Brand Changer, BungeeCord Commands, Protocol Blocker and Hostnames Manager for Velocity

Home Page:https://elytrium.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correctly unregistering Hub command and aliases

NaTorOG opened this issue · comments

commented

In VelocityTools.java, you should technically move these method inside the if clause.

    List<String> aliases = Settings.IMP.COMMANDS.HUB.ALIASES;
    aliases.forEach(alias -> this.server.getCommandManager().unregister(alias));
    if (Settings.IMP.COMMANDS.HUB.ENABLED && !aliases.isEmpty()) {
      List<String> aliases = Settings.IMP.COMMANDS.HUB.ALIASES;
      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 way we can avoid issues with other /hub or /lobby plugins since I can't use them anymore even with command disabled in the config of your plugin

I've already made the fix, let's wait till the merge #33