Fixed a weird crash relating to metadata on colored items.

This commit is contained in:
Vasco Lavos committed 2014-05-02 16:31:37 +01:00
1 parent a6a3a67de6
commit 9ea8ea5ae7
1 file changed
+3
@@ -29,6 +29,9 @@ public class Item16Colors extends ItemMod {
@Override
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
if(par1ItemStack.getItemDamage() >= EntitySheep.fleeceColorTable.length)
return 0xFFFFFF;
float[] color = EntitySheep.fleeceColorTable[par1ItemStack.getItemDamage()];
return new Color(color[0], color[1], color[2]).getRGB();
}