Add password protected warps

This commit is contained in:
Trent Hensler
2017-12-19 02:10:52 -08:00
parent 18749dcb06
commit ce132ed033
5 changed files with 41 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ public class CmdSetFWarp extends FCommand {
this.aliases.add("setwarp");
this.aliases.add("sw");
this.requiredArgs.add("warp name");
this.optionalArgs.put("password", "password");
this.senderMustBeMember = true;
this.senderMustBeModerator = true;
this.senderMustBePlayer = true;
@@ -38,9 +39,14 @@ public class CmdSetFWarp extends FCommand {
}
String warp = argAsString(0);
String password = argAsString(1);
LazyLocation loc = new LazyLocation(fme.getPlayer().getLocation());
myFaction.setWarp(warp, loc);
fme.msg(TL.COMMAND_SETFWARP_SET, warp);
if (password != null) {
myFaction.setWarpPassword(warp, password);
}
fme.msg(TL.COMMAND_SETFWARP_SET, warp, password != null ? password : "");
}
private boolean transact(FPlayer player) {