[Demonstration 1]

[Buggy Method]
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
    if (!worldIn.isRemote) {
        TileEntity te = worldIn.getTileEntity(pos);
        if (te != null) {
            TileDollPedestal tile = (TileDollPedestal) te;
            IItemHandler tileinv = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
            ItemStack stack = tileinv.getStackInSlot(0);
            if (stack != null) {
                EntityItem entItem = new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), stack);
                worldIn.spawnEntityInWorld(entItem);
            }
        }
    }
    super.breakBlock(worldIn, pos, state);
}

[Buggy Hunk]
worldIn.spawnEntityInWorld(entItem);

[Patch]
worldIn.spawnEntity(entItem);

[Demonstration 2]

[Buggy Method]
@Override
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
    if (rand.nextInt(2) == 0) {
        if (worldIn.getLightFromNeighbors(pos) <= 8 || UtilWorld.isDateAroundHalloween(worldIn.getCurrentDate()))
            doEntitySpawns(worldIn, pos, rand);
    } else {
        //Burn in daylight
        if (worldIn.canSeeSky(pos)) {
            if (worldIn.getWorldTime() >= 1000 && worldIn.getWorldTime() <= 13000) {
                worldIn.setBlockState(pos.up(), Blocks.FIRE.getDefaultState());
                if (rand.nextInt(2) == 0) {
                    worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
                } else {
                    worldIn.setBlockState(pos, Blocks.DIRT.getStateFromMeta(1));
                }
            }
        }
        //Spreading
        if (worldIn.getLightFromNeighbors(pos.up()) <= 8) {
            for (int i = 0; i < 4; ++i) {
                BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);
                if (blockpos.getY() >= 0 && blockpos.getY() < 256 && !worldIn.isBlockLoaded(blockpos)) {
                    return;
                }
                IBlockState iblockstate = worldIn.getBlockState(blockpos.up());
                IBlockState iblockstate1 = worldIn.getBlockState(blockpos);
                if (((iblockstate1.getBlock() == Blocks.DIRT && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT) || iblockstate1.getBlock() == Blocks.GRASS) && worldIn.getLightFromNeighbors(blockpos.up()) <= 8 && iblockstate.getLightOpacity(worldIn, pos.up()) <= 2) {
                    worldIn.setBlockState(blockpos, ModBlocks.cursed_earth.getDefaultState());
                }
            }
        }
        //Turn to dirt
        if (worldIn.getBlockState(pos.up()).isFullBlock()) {
            if (rand.nextInt(2) == 0) {
                worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
            } else {
                worldIn.setBlockState(pos, Blocks.DIRT.getStateFromMeta(1));
            }
        }
    }
}

[Buggy Hunk]
if (worldIn.getLightFromNeighbors(pos) <= 8 || UtilWorld.isDateAroundHalloween(worldIn.getCurrentDate())) doEntitySpawns(worldIn, pos, rand);

[Patch]
if ((worldIn.getLightFromNeighbors(pos) <= 8 || UtilWorld.isDateAroundHalloween(worldIn.getCurrentDate())) && worldIn.getGameRules().getBoolean("doMobSpawning")) doEntitySpawns(worldIn, pos, rand);

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    system.out.println("Welcome to Java");
}

[Buggy Hunk]
system.out.println("Welcome to Java");

[Patch]
System.out.println("Welcome to Java");