diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-13 20:27:28 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-13 20:27:28 +0000 |
commit | c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd (patch) | |
tree | ddfc69199f74e0abe98cae71ebf2aa6915966216 | |
parent | 5fc5b4c1a34fc8dac1003d8bd8b49043052260c5 (diff) | |
download | bukkit-c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd.tar bukkit-c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd.tar.gz bukkit-c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd.tar.lz bukkit-c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd.tar.xz bukkit-c69dd6a9e033749de8f20323d6b35ad8b0b8b8cd.zip |
Renamed Color -> ChatColor, and added DyeColor
-rw-r--r-- | src/main/java/org/bukkit/ChatColor.java (renamed from src/main/java/org/bukkit/Color.java) | 22 | ||||
-rw-r--r-- | src/main/java/org/bukkit/DyeColor.java | 44 | ||||
-rw-r--r-- | src/main/java/org/bukkit/fillr/Checker.java | 2 |
3 files changed, 56 insertions, 12 deletions
diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/ChatColor.java index f1bc64a2..990eb706 100644 --- a/src/main/java/org/bukkit/Color.java +++ b/src/main/java/org/bukkit/ChatColor.java @@ -4,9 +4,9 @@ import java.util.HashMap; import java.util.Map; /** - * All supported color values + * All supported color values for chat */ -public enum Color { +public enum ChatColor { BLACK(0x0), DARK_BLUE(0x1), DARK_GREEN(0x2), @@ -17,17 +17,17 @@ public enum Color { GRAY(0x7), DARK_GRAY(0x8), BLUE(0x9), - GREEN(0xa), - AQUA(0xb), - RED(0xc), - LIGHT_PURPLE(0xd), - YELLOW(0xe), - WHITE(0xf); + GREEN(0xA), + AQUA(0xB), + RED(0xC), + LIGHT_PURPLE(0xD), + YELLOW(0xE), + WHITE(0xF); private final int code; - private final static Map<Integer, Color> colors = new HashMap<Integer, Color>(); + private final static Map<Integer, ChatColor> colors = new HashMap<Integer, ChatColor>(); - private Color(final int code) { + private ChatColor(final int code) { this.code = code; } @@ -41,7 +41,7 @@ public enum Color { } static { - for (Color color : Color.values()) { + for (ChatColor color : ChatColor.values()) { colors.put(color.getCode(), color); } } diff --git a/src/main/java/org/bukkit/DyeColor.java b/src/main/java/org/bukkit/DyeColor.java new file mode 100644 index 00000000..f34de921 --- /dev/null +++ b/src/main/java/org/bukkit/DyeColor.java @@ -0,0 +1,44 @@ + +package org.bukkit; + +import java.util.HashMap; +import java.util.Map; + +/** + * All supported color values for dyes and cloth + */ +public enum DyeColor { + BLACK(0x0), + RED(0x1), + GREEN(0x2), + BROWN(0x3), + BLUE(0x4), + PURPLE(0x5), + CYAN(0x6), + SILVER(0x7), + GRAY(0x8), + PINK(0x9), + LIME(0xA), + YELLOW(0xB), + LIGHT_BLUE(0xC), + MAGENTA(0xD), + ORANGE(0xE), + WHITE(0xF); + + private final int data; + private final static Map<Integer, DyeColor> colors = new HashMap<Integer, DyeColor>(); + + private DyeColor(final int data) { + this.data = data; + } + + public int getValue() { + return data; + } + + static { + for (DyeColor color : DyeColor.values()) { + colors.put(color.getValue(), color); + } + } +} diff --git a/src/main/java/org/bukkit/fillr/Checker.java b/src/main/java/org/bukkit/fillr/Checker.java index 8ae176bc..f00b1363 100644 --- a/src/main/java/org/bukkit/fillr/Checker.java +++ b/src/main/java/org/bukkit/fillr/Checker.java @@ -43,7 +43,7 @@ public class Checker { PluginDescriptionFile pdfFile = Checker.getPDF(file); FillReader reader = needsUpdate(pdfFile); if (reader != null) { - player.sendMessage(Color.RED + reader.getName() + " " + pdfFile.getVersion() + " has an update to " + reader.getCurrVersion()); + player.sendMessage(ChatColor.RED + reader.getName() + " " + pdfFile.getVersion() + " has an update to " + reader.getCurrVersion()); } else { player.sendMessage(pdfFile.getName() + " " + pdfFile.getVersion() + " is up to date!"); } |