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

36 lines
900 B
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
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
{
2013-04-16 10:11:59 +02:00
this.addAliases("unclaim", "declaim");
2011-10-09 18:35:39 +02:00
2013-04-16 10:11:59 +02:00
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
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(sender, myFaction, true)) return;
// Apply
if (fme.tryClaim(newFaction, chunk, true, true)) return;
}
}