Maven Attempt 1

This commit is contained in:
Olof Larsson
2014-09-13 00:50:33 +02:00
parent 3debf17f27
commit 13a4afdfb4
170 changed files with 151 additions and 49 deletions

View File

@ -0,0 +1,46 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.massivecore.cmd.MassiveCommand;
import com.massivecraft.massivecore.cmd.req.ReqAbstract;
import com.massivecraft.massivecore.util.Txt;
public class ReqRoleIsAtLeast extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
private final Rel rel;
public Rel getRel() { return this.rel; }
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
public static ReqRoleIsAtLeast get(Rel rel) { return new ReqRoleIsAtLeast(rel); }
private ReqRoleIsAtLeast(Rel rel) { this.rel = rel; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MassiveCommand command)
{
UPlayer uplayer = UPlayer.get(sender);
return uplayer.getRole().isAtLeast(this.rel);
}
@Override
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
return Txt.parse("<b>You must be <h>%s <b>or higher to "+(command == null ? "do that" : command.getDesc())+".", Txt.getNicedEnum(this.rel));
}
}