Java Code Examples for org.bukkit.DyeColor#values()

The following examples show how to use org.bukkit.DyeColor#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Parser.java    From CardinalPGM with MIT License 4 votes vote down vote up
public static DyeColor parseDyeColor(String string) {
    for (DyeColor color : DyeColor.values()) {
        if (color.name().equals(Strings.getTechnicalName(string))) return color;
    }
    return DyeColor.WHITE;
}
 
Example 2
Source File: BannerUtils.java    From NovaGuilds with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Gets random dye color
 *
 * @return dye color
 */
protected static DyeColor randomDyeColor() {
	return DyeColor.values()[NumberUtils.randInt(0, DyeColor.values().length - 1)];
}