diff --git a/pom.xml b/pom.xml
index db3756a..5095027 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,10 +6,20 @@
de.deanomus
TCLobbySwitcher
- 1.0-SNAPSHOT
+ 3.0
TCLobbySwitcher
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 8
+
+
+
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/TCLobbySwitcher.java b/src/main/java/de/deanomus/tclobbyswitcher/TCLobbySwitcher.java
index 3f87409..47585c8 100644
--- a/src/main/java/de/deanomus/tclobbyswitcher/TCLobbySwitcher.java
+++ b/src/main/java/de/deanomus/tclobbyswitcher/TCLobbySwitcher.java
@@ -1,8 +1,15 @@
package de.deanomus.tclobbyswitcher;
import java.util.logging.Logger;
+
+import de.deanomus.tclobbyswitcher.cmd.LobbySwitcher_CMD;
+import de.deanomus.tclobbyswitcher.objects.ItemBuilder;
+import de.deanomus.tclobbyswitcher.utils.chat.Colors;
import org.bukkit.Bukkit;
+import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
+import org.bukkit.plugin.java.annotation.command.Command;
+import org.bukkit.plugin.java.annotation.command.Commands;
import org.bukkit.plugin.java.annotation.plugin.Description;
import org.bukkit.plugin.java.annotation.plugin.Plugin;
import org.bukkit.plugin.java.annotation.plugin.author.Author;
@@ -15,6 +22,9 @@
@Plugin(name="TCLobbySwitcher", version="3.0")
@Description(value="An TimoCloud Addon which adds an LobbySwitcher")
@Author(value="deanomus")
+@Commands(
+ @Command(name = "lobbyswitcher", desc = "Open's the lobbyswitcher gui")
+)
//@Dependency (value="TimoCloud")
public class TCLobbySwitcher extends JavaPlugin {
@@ -23,13 +33,18 @@ public class TCLobbySwitcher extends JavaPlugin {
public void onEnable() {
Logger log = Bukkit.getLogger();
- log.info("$aIt's starting o.O");
+ getCommand("lobbyswitcher").setExecutor(new LobbySwitcher_CMD());
+
+ log.info("It's starting o.O");
}
public void onDisable() {
+
}
+
+
}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/cmd/LobbySwitcher_CMD.java b/src/main/java/de/deanomus/tclobbyswitcher/cmd/LobbySwitcher_CMD.java
new file mode 100644
index 0000000..c0e6d07
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/cmd/LobbySwitcher_CMD.java
@@ -0,0 +1,22 @@
+package de.deanomus.tclobbyswitcher.cmd;
+
+import de.deanomus.tclobbyswitcher.utils.chat.Colors;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class LobbySwitcher_CMD implements CommandExecutor { //TODO: Gui
+
+ public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
+ if (!(sender instanceof Player)) {
+ sender.sendMessage(Colors.RED + "Only players can execute this command!");
+ return false;
+ }
+ Player p = (Player)sender;
+
+ p.sendMessage(Colors.ForestGreen + "Hello " + Colors.Aqua + p.getDisplayName() + Colors.ForestGreen + ".");
+
+ return false;
+ }
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/gui/ServerSelectorGUI.java b/src/main/java/de/deanomus/tclobbyswitcher/gui/ServerSelectorGUI.java
new file mode 100644
index 0000000..046c625
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/gui/ServerSelectorGUI.java
@@ -0,0 +1,15 @@
+package de.deanomus.tclobbyswitcher.gui;
+
+public class ServerSelectorGUI {
+
+
+ private String
+ servername;
+
+
+ public ServerSelectorGUI(String servername) {
+ this.servername = servername;
+ }
+
+
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/listener/ClickListener.java b/src/main/java/de/deanomus/tclobbyswitcher/listener/ClickListener.java
new file mode 100644
index 0000000..0638156
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/listener/ClickListener.java
@@ -0,0 +1,24 @@
+package de.deanomus.tclobbyswitcher.listener;
+
+import org.bukkit.Material;
+import org.bukkit.entity.Player;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.Listener;
+import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.material.MaterialData;
+
+public class ClickListener implements Listener {
+
+ @EventHandler
+ public void onLeftClick(PlayerInteractEvent e) {
+ Player p = e.getPlayer();
+
+ if (e.getItem().getItemMeta().hasDisplayName()) {
+ p.sendMessage("Item: " + e.getItem().getItemMeta().getDisplayName());
+ } else {
+ p.sendMessage("Item");
+ }
+
+ }
+
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/objects/GUI.java b/src/main/java/de/deanomus/tclobbyswitcher/objects/GUI.java
new file mode 100644
index 0000000..1bea1e2
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/objects/GUI.java
@@ -0,0 +1,11 @@
+package de.deanomus.tclobbyswitcher.objects;
+
+import org.bukkit.Bukkit;
+import org.bukkit.inventory.Inventory;
+
+public class GUI {
+
+
+
+
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/objects/ItemBuilder.java b/src/main/java/de/deanomus/tclobbyswitcher/objects/ItemBuilder.java
new file mode 100644
index 0000000..812c0bf
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/objects/ItemBuilder.java
@@ -0,0 +1,177 @@
+package de.deanomus.tclobbyswitcher.objects;
+
+import org.bukkit.Material;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.ItemMeta;
+
+import java.util.ArrayList;
+
+public class ItemBuilder {
+
+ // MUST !
+ private Material
+ material;
+
+ private short
+ subId;
+
+ private int
+ amount;
+
+
+ // OPTIONIALLY BUT RECOMMENED
+ private String
+ name;
+
+ // OPTIONIALLY
+ private ArrayList lores;
+
+
+ public ItemBuilder() {
+ this.material = Material.STONE;
+ this.subId = (short)0;
+ this.amount = 1;
+ }
+
+ /**
+ * Generate finally the ItemStack
+ * @return ItemStack
+ */
+ public ItemStack build() {
+ ItemStack item = new ItemStack(material, amount, subId);
+ ItemMeta itemMeta = item.getItemMeta();
+
+ // SET (DISPLAY-)NAME
+ if (this.name != null) {
+ itemMeta.setDisplayName(this.name);
+ }
+ // SET LORE
+ if (this.lores != null && this.lores.size() >= 1) {
+ itemMeta.setLore(this.lores);
+ }
+
+
+ item.setItemMeta(itemMeta);
+ return item;
+ }
+
+ /**
+ * Add loretext to lores array
+ * @param text
+ * @return ItemBuilder
+ */
+ public ItemBuilder addLoreText(String text) {
+ if (this.lores == null) {
+ this.lores = new ArrayList();
+ }
+ this.lores.add(text);
+ return this;
+ }
+
+ /**
+ * Add list of lorelexts to lores array
+ * @param text
+ * @return ItemBuilder
+ */
+ public ItemBuilder addLoreText(String[] text) {
+ for (String s : text) {
+ addLoreText(s);
+ }
+ return this;
+ }
+
+
+
+ // GETTER & SETTER
+
+ /**
+ * Returns the material
+ *
+ * @return Material
+ */
+ public Material getMaterial() {
+ return material;
+ }
+
+ /**
+ * Sets the material
+ * @param material
+ * @return ItemBuilder
+ */
+ public ItemBuilder setMaterial(Material material) {
+ this.material = material;
+ return this;
+ }
+
+ /**
+ * Returns the subId of material
+ * @return subId
+ */
+ public short getSubId() {
+ return subId;
+ }
+
+ /**
+ * Sets the subId
+ * @param subId
+ * @return ItemBuilder
+ */
+ public ItemBuilder setSubId(short subId) {
+ this.subId = subId;
+ return this;
+ }
+
+ /**
+ * Returns the amount
+ * @return amount
+ */
+ public int getAmount() {
+ return amount;
+ }
+
+ /**
+ * Sets the amount
+ * @param amount
+ * @return ItemBuilder
+ */
+ public ItemBuilder setAmount(int amount) {
+ this.amount = amount;
+ return this;
+ }
+
+ /**
+ * Returns the (display-)name
+ * @return
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the (display-)name
+ * @param name
+ * @return ItemBuilder
+ */
+ public ItemBuilder setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Returns the lores as list
+ * @return lores
+ */
+ public ArrayList getLores() {
+ return lores;
+ }
+
+ /**
+ * Sets the lores
+ * @param lores
+ * @return ItemBuilder
+ */
+ public ItemBuilder setLores(ArrayList lores) {
+ this.lores = lores;
+ return this;
+ }
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/utils/Helpers.java b/src/main/java/de/deanomus/tclobbyswitcher/utils/Helpers.java
new file mode 100644
index 0000000..26fe19e
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/utils/Helpers.java
@@ -0,0 +1,4 @@
+package de.deanomus.tclobbyswitcher.utils;
+
+public class Helpers {
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/utils/MinecraftVersion.java b/src/main/java/de/deanomus/tclobbyswitcher/utils/MinecraftVersion.java
new file mode 100644
index 0000000..fe1345f
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/utils/MinecraftVersion.java
@@ -0,0 +1,54 @@
+/**
+ * Thanks to TechsCode for this code snippet
+ */
+package de.deanomus.tclobbyswitcher.utils;
+
+import org.bukkit.Bukkit;
+
+import java.io.File;
+
+public enum MinecraftVersion {
+ UNKOWN,
+ V1_8_R1,
+ V1_8_R2,
+ V1_8_R3,
+ V1_9_R1,
+ V1_9_R2,
+ V1_10_R1,
+ V1_11_R1,
+ V1_12_R1,
+ V1_13_R1,
+ V1_13_R2,
+ V1_14_R1,
+ V1_15_R1,
+ V1_16_R1,
+ V1_16_R2,
+ V1_16_R3,
+ V1_16_R4;
+
+
+ private static MinecraftVersion currentVersion;
+
+ static {
+ try {
+ File file1 = new File("server.properties");
+ File file2 = new File("bukkit.yml");
+
+ if (file1.exists() && file2.exists()) {
+ currentVersion = valueOf(Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3].toUpperCase());
+ } else {
+ currentVersion = UNKOWN;
+ }
+ } catch (Exception exception) {
+ currentVersion = UNKOWN;
+ }
+ }
+
+ public boolean isAboveOrEqual(MinecraftVersion paramMinecraftVersion) {
+ return (ordinal() >= paramMinecraftVersion.ordinal());
+ }
+
+ public static MinecraftVersion getServersVersion() {
+ return currentVersion;
+ }
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Color.java b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Color.java
new file mode 100644
index 0000000..dc58c80
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Color.java
@@ -0,0 +1,71 @@
+/**
+ * Thanks to TechsCode for this code snippet
+ */
+package de.deanomus.tclobbyswitcher.utils.chat;
+
+import de.deanomus.tclobbyswitcher.utils.MinecraftVersion;
+
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+public class Color {
+ private final String colorCode;
+ private final int r;
+ private final int g;
+ private final int b;
+
+ public static Color from(String paramString) {
+ return new Color(paramString);
+ }
+
+ public static Color from(int paramInt1, int paramInt2, int paramInt3) {
+ java.awt.Color color = new java.awt.Color(paramInt1, paramInt2, paramInt3);
+ return from(Integer.toHexString(color.getRGB()).substring(2));
+ }
+
+ private Color(String paramString) {
+ this.colorCode = paramString.replace("#", "");
+
+ java.awt.Color color = new java.awt.Color(Integer.parseInt(this.colorCode, 16));
+ this.r = color.getRed();
+ this.g = color.getGreen();
+ this.b = color.getBlue();
+ }
+
+ public String getTag() {
+ return "{#" + this.colorCode + "}";
+ }
+
+ public String getColorCode() {
+ return this.colorCode;
+ }
+
+ public int getRed() {
+ return this.r;
+ }
+
+ public int getGreen() {
+ return this.g;
+ }
+
+ public int getBlue() {
+ return this.b;
+ }
+
+ public String getAppliedTag() {
+ boolean bool = MinecraftVersion.getServersVersion().isAboveOrEqual(MinecraftVersion.V1_16_R1);
+
+ if (bool) {
+ return "§x" + (String)Arrays.stream(this.colorCode.split("")).map(paramString -> "§" + paramString).collect(Collectors.joining());
+ }
+ return MinecraftColor.getClosest(this).getAppliedTag();
+ }
+
+ public static int difference(Color paramColor1, Color paramColor2) {
+ return Math.abs(paramColor1.r - paramColor2.r) + Math.abs(paramColor1.g - paramColor2.g) + Math.abs(paramColor1.b - paramColor2.b);
+ }
+
+ public String toString() {
+ return getAppliedTag();
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Colors.java b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Colors.java
new file mode 100644
index 0000000..223ae8d
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/Colors.java
@@ -0,0 +1,167 @@
+package de.deanomus.tclobbyswitcher.utils.chat;
+
+public class Colors {
+ public static Color AliceBlue = Color.from("#F0F8FF");
+ public static Color AntiqueWhite = Color.from("FAEBD7");
+ public static Color Aqua = Color.from("#00FFFF");
+ public static Color AQUA = Color.from("#55FFFF");
+ public static Color Aquamarine = Color.from("#7FFFD4");
+ public static Color Azure = Color.from("#F0FFFF");
+ public static Color Beige = Color.from("#F5F5DC");
+ public static Color Bisque = Color.from("#FFE4C4");
+ public static Color BLACK = Color.from("#000000");
+ public static Color BlanchedAlmond = Color.from("#FFEBCD");
+ public static Color Blue = Color.from("#0000FF");
+ public static Color BLUE = Color.from("#5555FF");
+ public static Color BlueViolet = Color.from("#8A2BE2");
+ public static Color Brown = Color.from("#A52A2A");
+ public static Color BurlyWood = Color.from("#DEB887");
+ public static Color CadetBlue = Color.from("#5F9EA0");
+ public static Color Chartreuse = Color.from("#7FFF00");
+ public static Color Chocolate = Color.from("#D2691E");
+ public static Color Coral = Color.from("#FF7F50");
+ public static Color CornflowerBlue = Color.from("#6495ED");
+ public static Color Cornsilk = Color.from("#FFF8DC");
+ public static Color Crimson = Color.from("#DC143C");
+ public static Color Cyan = Color.from("#00FFFF");
+ public static Color DarkBlue = Color.from("#00008B");
+ public static Color DARK_AQUA = Color.from("#00AAAA");
+ public static Color DARK_BLUE = Color.from("#0000AA");
+ public static Color DarkCyan = Color.from("#008B8B");
+ public static Color DarkGoldenRod = Color.from("#B8860B");
+ public static Color DarkGray = Color.from("#A9A9A9");
+ public static Color DARK_GRAY = Color.from("#555555");
+ public static Color DarkGreen = Color.from("#006400");
+ public static Color DARK_GREEN = Color.from("#00AA00");
+ public static Color DarkKhaki = Color.from("#BDB76B");
+ public static Color DarkMagenta = Color.from("#8B008B");
+ public static Color DarkOliveGreen = Color.from("#556B2F");
+ public static Color Darkorange = Color.from("#FF8C00");
+ public static Color DarkOrchid = Color.from("#9932CC");
+ public static Color DarkRed = Color.from("#8B0000");
+ public static Color DARK_RED = Color.from("#AA0000");
+ public static Color DarkSalmon = Color.from("#E9967A");
+ public static Color DarkSeaGreen = Color.from("#8FBC8F");
+ public static Color DarkSlateBlue = Color.from("#483D8B");
+ public static Color DarkSlateGray = Color.from("#2F4F4F");
+ public static Color DarkSlateGrey = Color.from("#2F4F4F");
+ public static Color DarkTurquoise = Color.from("#00CED1");
+ public static Color DarkViolet = Color.from("#9400D3");
+ public static Color DARK_PURPLE = Color.from("#AA00AA");
+ public static Color DeepPink = Color.from("#FF1493");
+ public static Color DeepSkyBlue = Color.from("#00BFFF");
+ public static Color DimGray = Color.from("#696969");
+ public static Color DimGrey = Color.from("#696969");
+ public static Color DodgerBlue = Color.from("#1E90FF");
+ public static Color FireBrick = Color.from("#B22222");
+ public static Color FloralWhite = Color.from("#FFFAF0");
+ public static Color ForestGreen = Color.from("#228B22");
+ public static Color Fuchsia = Color.from("#FF00FF");
+ public static Color Gainsboro = Color.from("#DCDCDC");
+ public static Color GhostWhite = Color.from("#F8F8FF");
+ public static Color Gold = Color.from("#FFD700");
+ public static Color GOLD = Color.from("#FFAA00");
+ public static Color GoldenRod = Color.from("#DAA520");
+ public static Color Gray = Color.from("#808080");
+ public static Color GRAY = Color.from("#AAAAAA");
+ public static Color Green = Color.from("#008000");
+ public static Color GREEN = Color.from("#55FF55");
+ public static Color GreenYellow = Color.from("#ADFF2F");
+ public static Color HoneyDew = Color.from("#F0FFF0");
+ public static Color HotPink = Color.from("#FF69B4");
+ public static Color IndianRed = Color.from("#CD5C5C");
+ public static Color Indigo = Color.from("#4B0082");
+ public static Color Ivory = Color.from("#FFFFF0");
+ public static Color Khaki = Color.from("#F0E68C");
+ public static Color Lavender = Color.from("#E6E6FA");
+ public static Color LavenderBlush = Color.from("#FFF0F5");
+ public static Color LawnGreen = Color.from("#7CFC00");
+ public static Color LemonChiffon = Color.from("#FFFACD");
+ public static Color LightBlue = Color.from("#ADD8E6");
+ public static Color LightCoral = Color.from("#F08080");
+ public static Color LightCyan = Color.from("#E0FFFF");
+ public static Color LightGoldenRodYellow = Color.from("#FAFAD2");
+ public static Color LightGray = Color.from("#D3D3D3");
+ public static Color LightGrey = Color.from("#D3D3D3");
+ public static Color LightGreen = Color.from("#90EE90");
+ public static Color LightPink = Color.from("#FFB6C1");
+ public static Color LIGHT_PURPLE = Color.from("#FF55FF");
+ public static Color LightSalmon = Color.from("#FFA07A");
+ public static Color LightSeaGreen = Color.from("#20B2AA");
+ public static Color LightSkyBlue = Color.from("#87CEFA");
+ public static Color LightSlateGray = Color.from("#778899");
+ public static Color LightSlateGrey = Color.from("#778899");
+ public static Color LightSteelBlue = Color.from("#B0C4DE");
+ public static Color LightYellow = Color.from("#FFFFE0");
+ public static Color Lime = Color.from("#00FF00");
+ public static Color LimeGreen = Color.from("#32CD32");
+ public static Color Linen = Color.from("#FAF0E6");
+ public static Color Magenta = Color.from("#FF00FF");
+ public static Color Maroon = Color.from("#800000");
+ public static Color MediumAquaMarine = Color.from("#66CDAA");
+ public static Color MediumBlue = Color.from("#0000CD");
+ public static Color MediumOrchid = Color.from("#BA55D3");
+ public static Color MediumPurple = Color.from("#9370D8");
+ public static Color MediumSeaGreen = Color.from("#3CB371");
+ public static Color MediumSlateBlue = Color.from("#7B68EE");
+ public static Color MediumSpringGreen = Color.from("#00FA9A");
+ public static Color MediumTurquoise = Color.from("#48D1CC");
+ public static Color MediumVioletRed = Color.from("#C71585");
+ public static Color MidnightBlue = Color.from("#191970");
+ public static Color MintCream = Color.from("#F5FFFA");
+ public static Color MistyRose = Color.from("#FFE4E1");
+ public static Color Moccasin = Color.from("#FFE4B5");
+ public static Color NavajoWhite = Color.from("#FFDEAD");
+ public static Color Navy = Color.from("#000080");
+ public static Color OldLace = Color.from("#FDF5E6");
+ public static Color Olive = Color.from("#808000");
+ public static Color OliveDrab = Color.from("#6B8E23");
+ public static Color Orange = Color.from("#FFA500");
+ public static Color OrangeRed = Color.from("#FF4500");
+ public static Color Orchid = Color.from("#DA70D6");
+ public static Color PaleGoldenRod = Color.from("#EEE8AA");
+ public static Color PaleGreen = Color.from("#98FB98");
+ public static Color PaleTurquoise = Color.from("#AFEEEE");
+ public static Color PaleVioletRed = Color.from("#D87093");
+ public static Color PapayaWhip = Color.from("#FFEFD5");
+ public static Color PeachPuff = Color.from("#FFDAB9");
+ public static Color Peru = Color.from("#CD853F");
+ public static Color Pink = Color.from("#FFC0CB");
+ public static Color Plum = Color.from("#DDA0DD");
+ public static Color PowderBlue = Color.from("#B0E0E6");
+ public static Color Purple = Color.from("#800080");
+ public static Color Red = Color.from("#FF0000");
+ public static Color RED = Color.from("#FF5555");
+ public static Color RosyBrown = Color.from("#BC8F8F");
+ public static Color RoyalBlue = Color.from("#4169E1");
+ public static Color SaddleBrown = Color.from("#8B4513");
+ public static Color Salmon = Color.from("#FA8072");
+ public static Color SandyBrown = Color.from("#F4A460");
+ public static Color SeaGreen = Color.from("#2E8B57");
+ public static Color SeaShell = Color.from("#FFF5EE");
+ public static Color Sienna = Color.from("#A0522D");
+ public static Color Silver = Color.from("#C0C0C0");
+ public static Color SkyBlue = Color.from("#87CEEB");
+ public static Color SlateBlue = Color.from("#6A5ACD");
+ public static Color SlateGray = Color.from("#708090");
+ public static Color SlateGrey = Color.from("#708090");
+ public static Color Snow = Color.from("#FFFAFA");
+ public static Color SpringGreen = Color.from("#00FF7F");
+ public static Color SteelBlue = Color.from("#4682B4");
+ public static Color Tan = Color.from("#D2B48C");
+ public static Color Teal = Color.from("#008080");
+ public static Color Thistle = Color.from("#D8BFD8");
+ public static Color Tomato = Color.from("#FF6347");
+ public static Color Turquoise = Color.from("#40E0D0");
+ public static Color Violet = Color.from("#EE82EE");
+ public static Color Wheat = Color.from("#F5DEB3");
+ public static Color WHITE = Color.from("#FFFFFF");
+ public static Color WhiteSmoke = Color.from("#F5F5F5");
+ public static Color Yellow = Color.from("#FFFF00");
+ public static Color YELLOW = Color.from("#FFFF55");
+ public static Color YellowGreen = Color.from("#9ACD32");
+
+
+ public Colors() {
+ }
+}
diff --git a/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/MinecraftColor.java b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/MinecraftColor.java
new file mode 100644
index 0000000..3e9e6b1
--- /dev/null
+++ b/src/main/java/de/deanomus/tclobbyswitcher/utils/chat/MinecraftColor.java
@@ -0,0 +1,65 @@
+package de.deanomus.tclobbyswitcher.utils.chat;
+
+public enum MinecraftColor {
+ DARK_RED("&4", "#AA0000"),
+ RED("&c", "#FF5555"),
+ GOLD("&6", "#FFAA00"),
+ YELLOW("&e", "#FFFF55"),
+ DARK_GREEN("&2", "#00AA00"),
+ GREEN("&a", "#55FF55"),
+ AQUA("&b", "#55FFFF"),
+ DARK_AQUA("&3", "#00AAAA"),
+ DARK_BLUE("&1", "#0000AA"),
+ BLUE("&9", "#5555FF"),
+ LIGHT_PURPLE("&d", "#FF55FF"),
+ DARK_PURPLE("&5", "#AA00AA"),
+ WHITE("&f", "#FFFFFF"),
+ GRAY("&7", "#AAAAAA"),
+ DARK_GRAY("&8", "#555555"),
+ BLACK("&0", "#000000");
+
+ public static MinecraftColor getClosest(Color paramColor) {
+ MinecraftColor minecraftColor = null;
+ int i = 0;
+
+ for (MinecraftColor minecraftColor1 : values()) {
+ int j = Color.difference(paramColor, minecraftColor1.getColor());
+
+ if (minecraftColor == null || i > j) {
+ i = j;
+ minecraftColor = minecraftColor1;
+ }
+ }
+
+ return minecraftColor;
+ }
+
+ private final String chatColor;
+ private final Color color;
+
+ MinecraftColor(String paramString1, String paramString2) {
+ this.chatColor = paramString1;
+ this.color = Color.from(paramString2);
+ }
+
+ public String getName() {
+ return name().toLowerCase();
+ }
+
+ public Color getColor() {
+ return this.color;
+ }
+
+ public String getTag() {
+ return this.chatColor;
+ }
+
+ public String getAppliedTag() {
+ return this.chatColor.replace("&", "§");
+ }
+
+
+ public String toString() {
+ return getAppliedTag();
+ }
+}
\ No newline at end of file