mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-18 08:35:58 +01:00
fix commands
This commit is contained in:
parent
d077fcd907
commit
369e2c798e
@ -94,7 +94,7 @@ public class CommandManager {
|
|||||||
// Attempt to execute a command.
|
// Attempt to execute a command.
|
||||||
public void executeMethod(Method parent, String[] args, Player player, Object[] methodArgs) throws CommandException {
|
public void executeMethod(Method parent, String[] args, Player player, Object[] methodArgs) throws CommandException {
|
||||||
String cmdName = args[0];
|
String cmdName = args[0];
|
||||||
String modifier = args.length >= 1 ? args[1] : "";
|
String modifier = args.length > 1 ? args[1] : "";
|
||||||
|
|
||||||
Method method = commands.get(cmdName.toLowerCase() + " " + modifier.toLowerCase());
|
Method method = commands.get(cmdName.toLowerCase() + " " + modifier.toLowerCase());
|
||||||
if (method == null)
|
if (method == null)
|
||||||
@ -157,9 +157,8 @@ public class CommandManager {
|
|||||||
Set<String> cmds = new HashSet<String>();
|
Set<String> cmds = new HashSet<String>();
|
||||||
for (String cmd : commands.keySet()) {
|
for (String cmd : commands.keySet()) {
|
||||||
String[] split = cmd.split(" ");
|
String[] split = cmd.split(" ");
|
||||||
if (split[0].equalsIgnoreCase(command)) {
|
if (split[0].equalsIgnoreCase(command) && split.length > 1)
|
||||||
cmds.add(split[1]);
|
cmds.add(split[1]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmds.toArray(new String[cmds.size()]);
|
return cmds.toArray(new String[cmds.size()]);
|
||||||
|
@ -41,7 +41,7 @@ public class NPCCommands {
|
|||||||
public void showInfo(CommandContext args, Player player, NPC npc) {
|
public void showInfo(CommandContext args, Player player, NPC npc) {
|
||||||
Messaging.send(player, StringHelper.wrapHeader(npc.getName()));
|
Messaging.send(player, StringHelper.wrapHeader(npc.getName()));
|
||||||
Messaging.send(player, " <a>ID: <e>" + npc.getId());
|
Messaging.send(player, " <a>ID: <e>" + npc.getId());
|
||||||
Messaging.send(player, " <a>Character: <e>" + npc.getId());
|
Messaging.send(player, " <a>Character: <e>" + npc.getCharacter().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Loading…
Reference in New Issue
Block a user