45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
package com.massivecraft.factions.cmd;
|
|
|
|
import com.massivecraft.factions.Perm;
|
|
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
|
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
|
import com.massivecraft.massivecore.ps.PS;
|
|
|
|
import java.util.Collections;
|
|
import java.util.Set;
|
|
|
|
|
|
public class CmdFactionsSetOne extends CmdFactionsSetXSimple
|
|
{
|
|
// -------------------------------------------- //
|
|
// CONSTRUCT
|
|
// -------------------------------------------- //
|
|
|
|
public CmdFactionsSetOne(boolean claim)
|
|
{
|
|
// Super
|
|
super(claim);
|
|
|
|
// Aliases
|
|
this.addAliases("one");
|
|
|
|
// Requirements
|
|
this.addRequirements(RequirementIsPlayer.get());
|
|
Perm perm = claim ? Perm.CLAIM_ONE : Perm.UNCLAIM_ONE;
|
|
this.addRequirements(RequirementHasPerm.get(perm));
|
|
}
|
|
|
|
// -------------------------------------------- //
|
|
// OVERRIDE
|
|
// -------------------------------------------- //
|
|
|
|
@Override
|
|
public Set<PS> getChunks()
|
|
{
|
|
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
|
final Set<PS> chunks = Collections.singleton(chunk);
|
|
return chunks;
|
|
}
|
|
|
|
}
|