Add the admininfo command info TFM

This commit is contained in:
ZeroEpoch1969
2018-07-26 00:10:54 -07:00
parent 551a0b2317
commit 7a2b7ec78b
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,35 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.List;
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
@CommandParameters(description = "Information on how to apply for admin.", usage = "/<command> [message...]", aliases = "ai")
public class Command_admininfo extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
List<String> adminInfo = ConfigEntry.ADMININFO.getStringList();
if (adminInfo.isEmpty())
{
msg("There is no admin information set in the config.", ChatColor.RED);
}
else
{
msg(FUtil.colorize(StringUtils.join(adminInfo, "\n")));
}
return true;
}
}

View File

@ -98,6 +98,7 @@ public enum ConfigEntry
OVERLORD_IPS(List.class, "overlord_ips"),
NOADMIN_IPS(List.class, "noadmin_ips"),
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
ADMININFO(List.class, "admininfo"),
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
//
AMP_ENABLED(Boolean.class, "amp.enabled"),