mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-13 10:51:41 +01:00
fix commands
This commit is contained in:
parent
adbe8a3518
commit
f82119f702
@ -94,7 +94,7 @@ public class CommandManager {
|
||||
// Attempt to execute a command.
|
||||
public void executeMethod(Method parent, String[] args, Player player, Object[] methodArgs) throws CommandException {
|
||||
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());
|
||||
if (method == null)
|
||||
@ -157,10 +157,9 @@ public class CommandManager {
|
||||
Set<String> cmds = new HashSet<String>();
|
||||
for (String cmd : commands.keySet()) {
|
||||
String[] split = cmd.split(" ");
|
||||
if (split[0].equalsIgnoreCase(command)) {
|
||||
if (split[0].equalsIgnoreCase(command) && split.length > 1)
|
||||
cmds.add(split[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return cmds.toArray(new String[cmds.size()]);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class NPCCommands {
|
||||
public void showInfo(CommandContext args, Player player, NPC npc) {
|
||||
Messaging.send(player, StringHelper.wrapHeader(npc.getName()));
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user