ReqTitlesAvailable

This commit is contained in:
Olof Larsson 2015-08-28 09:00:06 +02:00
parent 602ac30f8c
commit e0548bbc60
2 changed files with 38 additions and 0 deletions

View File

@ -7,6 +7,7 @@ public class Lang
public static final String COMMAND_SENDER_MUST_BE_PLAYER = "<b>This command can only be used by ingame players.";
public static final String COMMAND_SENDER_MUSNT_BE_PLAYER = "<b>This command can not be used by ingame players.";
public static final String COMMAND_TITLES_MUST_BE_AVAILABLE = "<b>This command requires the Minecraft 1.8 titles.";
public static final String COMMAND_TOO_FEW_ARGS = "<b>Not enough command input. <i>You should use it like this:";
public static final String COMMAND_TOO_MANY_ARGS = "<b>Too much command input %s<b>.";
public static final String COMMAND_TOO_MANY_ARGS2 = "<i>You should use the command like this:";

View File

@ -0,0 +1,37 @@
package com.massivecraft.massivecore.cmd.req;
import org.bukkit.command.CommandSender;
import com.massivecraft.massivecore.Lang;
import com.massivecraft.massivecore.cmd.MassiveCommand;
import com.massivecraft.massivecore.mixin.Mixin;
import com.massivecraft.massivecore.util.Txt;
public class ReqTitlesAvailable extends ReqAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReqTitlesAvailable i = new ReqTitlesAvailable();
public static ReqTitlesAvailable get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean apply(CommandSender sender, MassiveCommand command)
{
return Mixin.isTitlesAvailable();
}
@Override
public String createErrorMessage(CommandSender sender, MassiveCommand command)
{
return Txt.parse(Lang.COMMAND_TITLES_MUST_BE_AVAILABLE);
}
}