From 7a2b7ec78b4967f49418d64adceb3e380eca2570 Mon Sep 17 00:00:00 2001 From: ZeroEpoch1969 <13510767+ZeroEpoch1969@users.noreply.github.com> Date: Thu, 26 Jul 2018 00:10:54 -0700 Subject: [PATCH] Add the admininfo command info TFM --- .../command/Command_admininfo.java | 35 +++++++++++++++++++ .../totalfreedommod/config/ConfigEntry.java | 1 + src/main/resources/config.yml | 9 +++++ 3 files changed, 45 insertions(+) create mode 100644 src/main/java/me/totalfreedom/totalfreedommod/command/Command_admininfo.java diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_admininfo.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_admininfo.java new file mode 100644 index 00000000..a76c1ee2 --- /dev/null +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_admininfo.java @@ -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 = "/ [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 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; + } +} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java index 87306a2c..d5c3c354 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/config/ConfigEntry.java @@ -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"), diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 57fe9eeb..bb2375b2 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -283,6 +283,15 @@ announcer: - 'Racism, nazism, and sexism are strictly forbidden!' - 'Join our Discord server! Link: https://discordapp.com/invite/XXjmAmV/' +# What to display in the admininfo command. +admininfo: + - '&bHow to apply for admin on the TotalFreedom Server:' + - ' &6- Do not ask for admin in game' + - ' &2- Be helpful within the server' + - ' &6- Report those breaking the rules' + - ' &2- And apply on our forums at the link:' + - ' &9www.totalfreedom.boards.net' + # Famous players - cannot be banned by username famous_players: - honeydew