Fixed the Signal Flare item crashing if an invalid color is loaded somehow.

This commit is contained in:
Lizbeth Rika committed 2014-12-15 12:46:14 +00:00
1 parent 17bc5ea3d7
commit ba454c6358
1 file changed
+4
@@ -101,6 +101,10 @@ public class ItemSignalFlare extends ItemMod {
if(par2 == 0)
return 0xFFFFFF;
int colorv = getColor(par1ItemStack);
if(colorv >= EntitySheep.fleeceColorTable.length || colorv < 0)
return 0xFFFFFF;
float[] color = EntitySheep.fleeceColorTable[getColor(par1ItemStack)];
return new Color(color[0], color[1], color[2]).getRGB();
}