Merge branch 'master' of git@github.com:graywolf336/Jail.git

This commit is contained in:
graywolf336 2014-04-28 20:11:58 -05:00
commit cb88948c29
3 changed files with 15 additions and 2 deletions

View File

@ -622,7 +622,7 @@ public class JailIO {
for(String uuid : prisoners) { for(String uuid : prisoners) {
String pNode = node + "prisoners." + uuid + "."; String pNode = node + "prisoners." + uuid + ".";
Prisoner pris = new Prisoner(uuid, Prisoner pris = new Prisoner(uuid,
flat.getString(pNode + "prisoner"), flat.getString(pNode + "name"),
flat.getBoolean(pNode + "muted"), flat.getBoolean(pNode + "muted"),
flat.getLong(pNode + "time"), flat.getLong(pNode + "time"),
flat.getString(pNode + "jailer"), flat.getString(pNode + "jailer"),

View File

@ -149,7 +149,7 @@ public class JailMain extends JavaPlugin {
* Send the command off to the CommandHandler class, that way this main class doesn't get clogged up. * Send the command off to the CommandHandler class, that way this main class doesn't get clogged up.
*/ */
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) { public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
if(command.getName().equalsIgnoreCase("jail")) { if(commandLabel.equalsIgnoreCase("jail") || commandLabel.equalsIgnoreCase("j")) {
jh.parseCommand(jm, sender, args); jh.parseCommand(jm, sender, args);
}else { }else {
cmdHand.handleCommand(jm, sender, command.getName().toLowerCase(), args); cmdHand.handleCommand(jm, sender, command.getName().toLowerCase(), args);

View File

@ -61,6 +61,19 @@ public class CommandHandler {
//If no matches were found, send them the unknown command message. //If no matches were found, send them the unknown command message.
if(matches.size() == 0) { if(matches.size() == 0) {
if(commandLine.startsWith("jail")) {
String j = commandLine.substring(0, 4);
String a0 = commandLine.substring(4, commandLine.length());
ArrayList<String> args2 = new ArrayList<String>();
for(String s : args)
args2.add(s);
args2.add(a0);
if(jailmanager.getPlugin().onCommand(sender, null, j, args2.toArray(new String[args2.size()])))
return;
}
sender.sendMessage(jailmanager.getPlugin().getJailIO().getLanguageString(LangString.UNKNOWNCOMMAND, commandLine)); sender.sendMessage(jailmanager.getPlugin().getJailIO().getLanguageString(LangString.UNKNOWNCOMMAND, commandLine));
return; return;
} }