Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ua.end433.colorexpansion;
- import me.clip.placeholderapi.expansion.PlaceholderExpansion;
- import org.bukkit.ChatColor;
- import org.bukkit.OfflinePlayer;
- public class Main extends PlaceholderExpansion {
- public boolean canRegister() {
- return true;
- }
- public String getAuthor() {
- return "end433";
- }
- public String getIdentifier() {
- return "color";
- }
- public String getVersion() {
- return "1.2";
- }
- public String onRequest(OfflinePlayer p, String params) {
- if (params.equalsIgnoreCase("black"))
- return ChatColor.BLACK.toString();
- if (params.equalsIgnoreCase("dark_blue"))
- return ChatColor.DARK_BLUE.toString();
- if (params.equalsIgnoreCase("dark_green"))
- return ChatColor.DARK_GREEN.toString();
- if (params.equalsIgnoreCase("dark_aqua"))
- return ChatColor.DARK_AQUA.toString();
- if (params.equalsIgnoreCase("dark_red"))
- return ChatColor.DARK_RED.toString();
- if (params.equalsIgnoreCase("dark_purple"))
- return ChatColor.DARK_PURPLE.toString();
- if (params.equalsIgnoreCase("gold"))
- return ChatColor.GOLD.toString();
- if (params.equalsIgnoreCase("gray"))
- return ChatColor.GRAY.toString();
- if (params.equalsIgnoreCase("dark_gray"))
- return ChatColor.DARK_GRAY.toString();
- if (params.equalsIgnoreCase("blue"))
- return ChatColor.BLUE.toString();
- if (params.equalsIgnoreCase("green"))
- return ChatColor.GREEN.toString();
- if (params.equalsIgnoreCase("aqua"))
- return ChatColor.AQUA.toString();
- if (params.equalsIgnoreCase("red"))
- return ChatColor.RED.toString();
- if (params.equalsIgnoreCase("purple"))
- return ChatColor.LIGHT_PURPLE.toString();
- if (params.equalsIgnoreCase("yellow"))
- return ChatColor.YELLOW.toString();
- if (params.equalsIgnoreCase("white"))
- return ChatColor.WHITE.toString();
- if (params.equalsIgnoreCase("reset"))
- return ChatColor.RESET.toString();
- if (params.equalsIgnoreCase("obfuscated"))
- return ChatColor.MAGIC.toString();
- if (params.equalsIgnoreCase("italic"))
- return ChatColor.ITALIC.toString();
- if (params.equalsIgnoreCase("bold"))
- return ChatColor.BOLD.toString();
- if (params.equalsIgnoreCase("underline"))
- return ChatColor.UNDERLINE.toString();
- if (params.equalsIgnoreCase("strikethrough"))
- return ChatColor.STRIKETHROUGH.toString();
- if (params.equalsIgnoreCase("strike"))
- return ChatColor.STRIKETHROUGH.toString();
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement