private boolean breakup(@Nonnull IBlockState state, @Nonnull World worldIn, @Nonnull BlockPos pos, float baseChance) {
if (!worldIn.isRemote && RANDOM.nextFloat() < (state.getValue(LEVEL) + 1) * baseChance) {
int count;
switch (state.getValue(LEVEL)) {
case 2:
count = 9 * 9 * 9;
break;
case 1:
count = 9 * 9;
break;
default:
count = 9;
}
worldIn.setBlockToAir(pos);
worldIn.playEvent(2001, pos, Block.getStateId(state));
while (count > 0) {
int num = MathHelper.clamp(RANDOM.nextInt(Math.max(count / 5, 1)), 1, Math.min(count, 64));
count -= num;
spawnAsEntity(worldIn, pos, crazypants.enderio.base.material.material.Material.POWDER_INFINITY.getStack(num));
}
if (RANDOM.nextFloat() < (state.getValue(LEVEL) + 1) * .3f) {
CapturedMob capturedMob = CapturedMob.create(new ResourceLocation("minecraft", "endermite"));
if (capturedMob != null) {
capturedMob.doSpawn(worldIn, pos, EnumFacing.DOWN, false);
}
}
return true;
}
return false;
}