use of net.minecraft.item.ItemDye in project ArsMagica2 by Mithion.
the class Light method getColorMeta.
private int getColorMeta(ItemStack spell) {
int meta = 15;
int color = 0xFFFFFF;
if (SpellUtils.instance.modifierIsPresent(SpellModifiers.COLOR, spell, 0)) {
ISpellModifier[] mods = SpellUtils.instance.getModifiersForStage(spell, 0);
int ordinalCount = 0;
for (ISpellModifier mod : mods) {
if (mod instanceof Colour) {
byte[] data = SpellUtils.instance.getModifierMetadataFromStack(spell, mod, 0, ordinalCount++);
color = (int) mod.getModifier(SpellModifiers.COLOR, null, null, null, data);
}
}
}
for (int i = 0; i < 16; ++i) {
if (((ItemDye) Items.dye).field_150922_c[i] == color) {
meta = i;
break;
}
}
return meta;
}
Aggregations