Factions/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java

40 lines
1.1 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2013-04-25 13:25:15 +02:00
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
2013-04-22 09:37:53 +02:00
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Perm;
2013-04-16 10:11:59 +02:00
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
import com.massivecraft.mcore.ps.PS;
2013-04-10 13:12:22 +02:00
public class CmdFactionsUnclaim extends FCommand
2011-10-09 18:35:39 +02:00
{
2013-04-10 13:12:22 +02:00
public CmdFactionsUnclaim()
2011-10-09 18:35:39 +02:00
{
this.addAliases("unclaim");
2011-10-09 18:35:39 +02:00
2013-04-25 13:25:15 +02:00
this.addRequirements(ReqFactionsEnabled.get());
2013-04-16 10:11:59 +02:00
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get());
}
@Override
2011-10-09 18:35:39 +02:00
public void perform()
{
// Args
PS chunk = PS.valueOf(me).getChunk(true);
Faction newFaction = FactionColls.get().get(me).getNone();
// FPerm
if (!FPerm.TERRITORY.has(usender, usenderFaction, true)) return;
// Apply
if (usender.tryClaim(newFaction, chunk, true, true)) return;
}
}