Fix floating flower lightlevel crash

This commit is contained in:
Vincent Lee committed 2016-02-07 21:55:44 -06:00
1 parent 512884729e
commit b9b066617a
1 file changed
+2 -1
@@ -84,7 +84,8 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
@Override
public int getLightValue(IBlockAccess world, BlockPos pos) {
int currentLight = ((TileSpecialFlower) world.getTileEntity(pos)).getLightValue();
TileEntity tile = world.getTileEntity(pos);
int currentLight = tile instanceof TileSpecialFlower ? ((TileSpecialFlower) tile).getLightValue() : -1;
if(currentLight == -1)
currentLight = originalLight;
return LightHelper.getPackedColor(world.getBlockState(pos).getValue(BotaniaStateProps.COLOR), currentLight);