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