Advertisement
end433

code of ColorExpansion

Dec 16th, 2024
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.55 KB | Source Code | 0 0
  1. package ua.end433.colorexpansion;
  2.  
  3. import me.clip.placeholderapi.expansion.PlaceholderExpansion;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.OfflinePlayer;
  6.  
  7. public class Main extends PlaceholderExpansion {
  8.   public boolean canRegister() {
  9.     return true;
  10.   }
  11.  
  12.   public String getAuthor() {
  13.     return "end433";
  14.   }
  15.  
  16.   public String getIdentifier() {
  17.     return "color";
  18.   }
  19.  
  20.   public String getVersion() {
  21.     return "1.2";
  22.   }
  23.  
  24.   public String onRequest(OfflinePlayer p, String params) {
  25.     if (params.equalsIgnoreCase("black"))
  26.       return ChatColor.BLACK.toString();
  27.     if (params.equalsIgnoreCase("dark_blue"))
  28.       return ChatColor.DARK_BLUE.toString();
  29.     if (params.equalsIgnoreCase("dark_green"))
  30.       return ChatColor.DARK_GREEN.toString();
  31.     if (params.equalsIgnoreCase("dark_aqua"))
  32.       return ChatColor.DARK_AQUA.toString();
  33.     if (params.equalsIgnoreCase("dark_red"))
  34.       return ChatColor.DARK_RED.toString();
  35.     if (params.equalsIgnoreCase("dark_purple"))
  36.       return ChatColor.DARK_PURPLE.toString();
  37.     if (params.equalsIgnoreCase("gold"))
  38.       return ChatColor.GOLD.toString();
  39.     if (params.equalsIgnoreCase("gray"))
  40.       return ChatColor.GRAY.toString();
  41.     if (params.equalsIgnoreCase("dark_gray"))
  42.       return ChatColor.DARK_GRAY.toString();
  43.     if (params.equalsIgnoreCase("blue"))
  44.       return ChatColor.BLUE.toString();
  45.     if (params.equalsIgnoreCase("green"))
  46.       return ChatColor.GREEN.toString();
  47.     if (params.equalsIgnoreCase("aqua"))
  48.       return ChatColor.AQUA.toString();
  49.     if (params.equalsIgnoreCase("red"))
  50.       return ChatColor.RED.toString();
  51.     if (params.equalsIgnoreCase("purple"))
  52.       return ChatColor.LIGHT_PURPLE.toString();
  53.     if (params.equalsIgnoreCase("yellow"))
  54.       return ChatColor.YELLOW.toString();
  55.     if (params.equalsIgnoreCase("white"))
  56.       return ChatColor.WHITE.toString();
  57.     if (params.equalsIgnoreCase("reset"))
  58.       return ChatColor.RESET.toString();
  59.     if (params.equalsIgnoreCase("obfuscated"))
  60.       return ChatColor.MAGIC.toString();
  61.     if (params.equalsIgnoreCase("italic"))
  62.       return ChatColor.ITALIC.toString();
  63.     if (params.equalsIgnoreCase("bold"))
  64.       return ChatColor.BOLD.toString();
  65.     if (params.equalsIgnoreCase("underline"))
  66.       return ChatColor.UNDERLINE.toString();
  67.     if (params.equalsIgnoreCase("strikethrough"))
  68.       return ChatColor.STRIKETHROUGH.toString();
  69.     if (params.equalsIgnoreCase("strike"))
  70.       return ChatColor.STRIKETHROUGH.toString();
  71.     return null;
  72.   }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement