allowing warps to be replaced at max warps
This commit is contained in:
parent
a47e06a34e
commit
ae61303a9b
@ -46,9 +46,14 @@ public class CmdSetFWarp extends FCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String warp = argAsString(0);
|
||||||
|
|
||||||
|
// Checks if warp with same name already exists and ignores maxWarp check if it does.
|
||||||
|
boolean warpExists = myFaction.isWarp(warp);
|
||||||
|
|
||||||
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
|
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
|
||||||
if (maxWarps <= myFaction.getWarps().size()) {
|
boolean tooManyWarps = maxWarps <= myFaction.getWarps().size();
|
||||||
|
if (tooManyWarps && !warpExists) {
|
||||||
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
|
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -57,7 +62,6 @@ public class CmdSetFWarp extends FCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String warp = argAsString(0);
|
|
||||||
String password = argAsString(1);
|
String password = argAsString(1);
|
||||||
|
|
||||||
LazyLocation loc = new LazyLocation(fme.getPlayer().getLocation());
|
LazyLocation loc = new LazyLocation(fme.getPlayer().getLocation());
|
||||||
|
Loading…
Reference in New Issue
Block a user