Factions3/src/com/massivecraft/factions/cmd/CmdFactionsSetOne.java

45 lines
1.1 KiB
Java
Raw Normal View History

2011-10-09 21:57:43 +02:00
package com.massivecraft.factions.cmd;
2014-10-13 11:42:40 +02:00
import java.util.Collections;
import java.util.Set;
2014-10-13 11:42:40 +02:00
import com.massivecraft.factions.Perm;
2015-11-06 02:10:29 +01:00
import com.massivecraft.massivecore.command.requirement.RequirementHasPerm;
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
2014-06-04 14:02:23 +02:00
import com.massivecraft.massivecore.ps.PS;
public class CmdFactionsSetOne extends CmdFactionsSetXSimple
2011-10-09 18:35:39 +02:00
{
2013-11-11 09:31:04 +01:00
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
2014-11-19 10:30:44 +01:00
public CmdFactionsSetOne(boolean claim)
2011-10-09 18:35:39 +02:00
{
2014-11-19 10:30:44 +01:00
// Super
super(claim);
2013-11-11 09:31:04 +01:00
// Aliases
2015-10-21 21:18:00 +02:00
this.addAliases("one");
2013-11-11 09:31:04 +01:00
// Requirements
2015-11-06 02:10:29 +01:00
this.addRequirements(RequirementIsPlayer.get());
2014-11-19 10:30:44 +01:00
String node = claim ? Perm.CLAIM_ONE.node : Perm.UNCLAIM_ONE.node;
2015-11-06 02:10:29 +01:00
this.addRequirements(RequirementHasPerm.get(node));
}
2013-11-11 09:31:04 +01:00
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public Set<PS> getChunks()
2011-10-09 18:35:39 +02:00
{
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
final Set<PS> chunks = Collections.singleton(chunk);
return chunks;
}
}