No compiletime errors anymore, how kewl. Let's test.

This commit is contained in:
Olof Larsson
2013-04-16 12:04:12 +02:00
parent 97a2ed1fd8
commit 4b9bdf0d94
26 changed files with 168 additions and 517 deletions

View File

@ -0,0 +1,42 @@
package com.massivecraft.factions.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqAbstract;
import com.massivecraft.mcore.util.Txt;
public class ReqBankCommandsEnabled extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqBankCommandsEnabled i = new ReqBankCommandsEnabled();
public static ReqBankCommandsEnabled get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MCommand command)
{
return ConfServer.econEnabled && ConfServer.bankEnabled;
}
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
if (!ConfServer.bankEnabled)
{
return Txt.parse("<b>The Factions bank system is disabled on this server.");
}
return Txt.parse("<b>The Factions economy features are disabled on this server.");
}
}

View File

@ -40,7 +40,7 @@ public class ReqRoleIsAtLeast extends ReqAbstract
@Override
public String createErrorMessage(CommandSender sender, MCommand command)
{
return Txt.parse("<b>You must be <h>%s <b>or higher to do this.", Txt.getNicedEnum(this.rel));
return Txt.parse("<b>You must be <h>%s <b>or higher to "+(command == null ? "do that" : command.getDesc())+".", Txt.getNicedEnum(this.rel));
}
}