Search in sources :

Example 1 with BlockColor

use of cn.nukkit.utils.BlockColor in project Nukkit by Nukkit.

the class ItemColorArmor method getColor.

/**
 * Get color of Leather Item
 *
 * @return - BlockColor, or null if item has no color
 */
public BlockColor getColor() {
    if (!this.hasCompoundTag())
        return null;
    CompoundTag tag = this.getNamedTag();
    if (!tag.exist("customColor"))
        return null;
    int rgb = tag.getInt("customColor");
    return new BlockColor(rgb);
}
Also used : BlockColor(cn.nukkit.utils.BlockColor) CompoundTag(cn.nukkit.nbt.tag.CompoundTag)

Aggregations

CompoundTag (cn.nukkit.nbt.tag.CompoundTag)1 BlockColor (cn.nukkit.utils.BlockColor)1