Tweaking requirements, removing declaim aliases and shortening the author list by using minecraft name only.

This commit is contained in:
Olof Larsson
2013-04-25 13:53:22 +02:00
parent 5047439756
commit 7a99005f7b
13 changed files with 98 additions and 15 deletions

View File

@@ -0,0 +1,37 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqAbstract;
import com.massivecraft.mcore.util.Txt;
public class ReqHasFaction extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqHasFaction i = new ReqHasFaction();
public static ReqHasFaction get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MCommand command)
{
return UPlayer.get(sender).hasFaction();
}
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
return Txt.parse("<b>You must belong to a faction to "+(command == null ? "do that" : command.getDesc())+".");
}
}

View File

@@ -0,0 +1,37 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqAbstract;
import com.massivecraft.mcore.util.Txt;
public class ReqHasntFaction extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqHasntFaction i = new ReqHasntFaction();
public static ReqHasntFaction get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MCommand command)
{
return !UPlayer.get(sender).hasFaction();
}
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
return Txt.parse("<b>You must leave your current faction before you "+(command == null ? "do that" : command.getDesc())+".");
}
}