Changed /command:command to /module:command
This commit is contained in:
@@ -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 + "'!");
|
||||
|
||||
Reference in New Issue
Block a user