Rename command files
This commit is contained in:
45
src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java
Normal file
45
src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.FPerm;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.Perm;
|
||||
|
||||
public class CmdFactionsAutoClaim extends FCommand
|
||||
{
|
||||
public CmdFactionsAutoClaim()
|
||||
{
|
||||
super();
|
||||
this.aliases.add("autoclaim");
|
||||
|
||||
//this.requiredArgs.add("");
|
||||
this.optionalArgs.put("faction", "your");
|
||||
|
||||
this.permission = Perm.AUTOCLAIM.node;
|
||||
this.disableOnLock = true;
|
||||
|
||||
senderMustBePlayer = true;
|
||||
senderMustBeMember = false;
|
||||
senderMustBeOfficer = false;
|
||||
senderMustBeLeader = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
Faction forFaction = this.argAsFaction(0, myFaction);
|
||||
if (forFaction == null || forFaction == fme.getAutoClaimFor())
|
||||
{
|
||||
fme.setAutoClaimFor(null);
|
||||
msg("<i>Auto-claiming of land disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! FPerm.TERRITORY.has(fme, forFaction, true)) return;
|
||||
|
||||
fme.setAutoClaimFor(forFaction);
|
||||
|
||||
msg("<i>Now auto-claiming land for <h>%s<i>.", forFaction.describeTo(fme));
|
||||
fme.attemptClaim(forFaction, me.getLocation(), true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user