13
0
geforkt von Mirrors/Paper

Fixed Colors + moved to enum

By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-01-03 21:31:15 +00:00
Ursprung c8ade7e5bb
Commit dfbb9305d2

Datei anzeigen

@ -1,20 +1,48 @@
package org.bukkit;
public class Color {
public static final String BLACK = "¤0";
public static final String DARK_BLUE = "¤1";
public static final String DARK_GREEN = "¤2";
public static final String DARK_AQUA = "¤3";
public static final String DARK_RED = "¤4";
public static final String DARK_PURPLE = "¤5";
public static final String GOLD = "¤6";
public static final String GRAY = "¤7";
public static final String DARK_GRAY = "¤8";
public static final String BLUE = "¤9";
public static final String GREEN = "¤a";
public static final String AQUA = "¤b";
public static final String RED = "¤c";
public static final String LIGHT_PURPLE = "¤d";
public static final String YELLOW = "¤e";
public static final String WHITE = "¤f";
import java.util.HashMap;
import java.util.Map;
/**
* All supported color values
*/
public enum Color {
BLACK(0x0),
DARK_BLUE(0x1),
DARK_GREEN(0x2),
DARK_AQUA(0x3),
DARK_RED(0x4),
DARK_PURPLE(0x5),
GOLD(0x6),
GRAY(0x7),
DARK_GRAY(0x8),
BLUE(0x9),
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 Color(final int code) {
this.code = code;
}
public int getCode() {
return code;
}
@Override
public String toString() {
return "\u00A7" + code;
}
static {
for (Color color : Color.values()) {
colors.put(color.getCode(), color);
}
}
}