Change command syntax for radius claiming.

Syntax was confusing and people wanted change. Resolves #215.
This commit is contained in:
drtshock 2015-01-15 13:27:11 -06:00
parent b7c34840cd
commit 4d13c9cada
2 changed files with 5 additions and 9 deletions

View File

@ -15,8 +15,8 @@ public class CmdClaim extends FCommand {
this.aliases.add("claim"); this.aliases.add("claim");
//this.requiredArgs.add(""); //this.requiredArgs.add("");
this.optionalArgs.put("faction", "your");
this.optionalArgs.put("radius", "1"); this.optionalArgs.put("radius", "1");
this.optionalArgs.put("faction", "your");
this.permission = Permission.CLAIM.node; this.permission = Permission.CLAIM.node;
this.disableOnLock = true; this.disableOnLock = true;
@ -30,8 +30,8 @@ public class CmdClaim extends FCommand {
@Override @Override
public void perform() { public void perform() {
// Read and validate input // Read and validate input
final Faction forFaction = this.argAsFaction(0, myFaction); int radius = this.argAsInt(0, 1); // Default to 1
int radius = this.argAsInt(1, 1); final Faction forFaction = this.argAsFaction(1, myFaction); // Default to own
if (radius < 1) { if (radius < 1) {
msg(TL.COMMAND_CLAIM_INVALIDRADIUS); msg(TL.COMMAND_CLAIM_INVALIDRADIUS);
@ -57,7 +57,7 @@ public class CmdClaim extends FCommand {
boolean success = fme.attemptClaim(forFaction, this.currentLocation(), true); boolean success = fme.attemptClaim(forFaction, this.currentLocation(), true);
if (success) { if (success) {
failCount = 0; failCount = 0;
} else if (!success && failCount++ >= limit) { } else if (failCount++ >= limit) {
this.stop(); this.stop();
return false; return false;
} }

View File

@ -188,12 +188,8 @@ public abstract class FCommand extends MCommand<P> {
Faction ret = def; Faction ret = def;
if (name != null) { if (name != null) {
Faction faction = null;
// First we try an exact match // First we try an exact match
if (faction == null) { Faction faction = Factions.getInstance().getByTag(name); // Checks for faction name match.
faction = Factions.getInstance().getByTag(name); // Checks for faction name match.
}
// Next we match faction tags // Next we match faction tags
if (faction == null) { if (faction == null) {