0

Changed /command:command to /module:command

This commit is contained in:
Minenash
2018-12-28 23:56:26 -05:00
parent 5f2da4a9da
commit 8f2200619e

View File

@@ -45,6 +45,7 @@ public class Executable extends org.bukkit.command.Command {
}
public void register(ArrayList<Method> methods, JavaPlugin plugin, Object methodContainer, ArrayList<String> aliases) {
String moduleName = methodContainer.getClass().getSimpleName();
for (HelpPageCommand[] page : help) {
for (HelpPageCommand cmd : page) {
if (cmd != null) {
@@ -94,13 +95,13 @@ public class Executable extends org.bukkit.command.Command {
@SuppressWarnings("unchecked")
Map<String, Command> knownCommands = (Map<String, Command>) knownCommandsField.get(map);
knownCommands.remove(name);
map.register(name, this);
map.register(moduleName, this);
for (String alias : aliases) {
Executable cmd = new Executable(alias, this.help);
cmd.commands = this.commands;
cmd.plugin = this.plugin;
knownCommands.remove(alias);
map.register(alias, cmd);
map.register(moduleName, cmd);
}
} catch (Exception e) {
plugin.getLogger().log(Level.SEVERE, "Failed to register command '" + name + "'!");