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

40 lines
1.1 KiB
Java

package com.massivecraft.factions.cmd;
import com.massivecraft.factions.cmd.req.ReqFactionsEnabled;
import com.massivecraft.factions.cmd.req.ReqHasFaction;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
import com.massivecraft.mcore.ps.PS;
public class CmdFactionsUnclaim extends FCommand
{
public CmdFactionsUnclaim()
{
this.addAliases("unclaim");
this.addRequirements(ReqFactionsEnabled.get());
this.addRequirements(ReqHasPerm.get(Perm.UNCLAIM.node));
this.addRequirements(ReqHasFaction.get());
this.addRequirements(ReqIsPlayer.get());
}
@Override
public void perform()
{
// Args
PS chunk = PS.valueOf(me).getChunk(true);
Faction newFaction = FactionColls.get().get(me).getNone();
// FPerm
if (!FPerm.TERRITORY.has(sender, usenderFaction, true)) return;
// Apply
if (usender.tryClaim(newFaction, chunk, true, true)) return;
}
}