[Demonstration 1]

[Buggy Method]
@SuppressWarnings("deprecation")
@Override
public boolean cast(EntityPlayer player, Entity caster, NBTTagCompound spell) {
    if (caster instanceof EntityItem && !caster.worldObj.isRemote) {
        int duration = spell.getInteger(DURATION);
        EntityItem item = (EntityItem) caster;
        ItemStack result = FurnaceRecipes.instance().getSmeltingResult(item.getEntityItem());
        if (result != null) {
            if (duration >= item.getEntityItem().stackSize) {
                EntityItem output = new EntityItem(item.worldObj, item.posX, item.posY + 0.5, item.posZ);
                result.stackSize *= item.getEntityItem().stackSize;
                output.setEntityItemStack(result);
                output.worldObj.spawnEntityInWorld(output);
                item.setDead();
            } else {
                EntityItem output = new EntityItem(item.worldObj, item.posX, item.posY + 0.5, item.posZ);
                result.stackSize *= duration;
                item.getEntityItem().stackSize -= duration;
                output.setEntityItemStack(result);
                output.worldObj.spawnEntityInWorld(output);
            }
        }
    } else if (caster instanceof EntityLivingBase) {
        int duration = spell.getInteger(DURATION);
        caster.setFire(MathHelper.ceiling_double_int(duration / 20.));
    } else if (caster instanceof SpellEntity) {
        BlockPos pos = caster.getPosition();
        IBlockState state = caster.worldObj.getBlockState(pos);
        Block block = state.getBlock();
        ItemStack stack = new ItemStack(block, 1, block.getMetaFromState(state));
        ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack);
        if (result != null) {
            Block smelted = Block.getBlockFromItem(result.getItem());
            if (smelted != null) {
                caster.worldObj.setBlockState(pos, smelted.getStateFromMeta(result.getMetadata()));
                caster.worldObj.playEvent(2001, pos, Block.getStateId(smelted.getDefaultState()));
            }
        }
    }
    for (int i = 0; i < 20; i++) {
        SparkleFX fizz = Wizardry.proxy.spawnParticleSparkle(caster.worldObj, caster.posX, caster.posY + 0.5, caster.posZ, 1F, 0.5F, 20, false);
        fizz.setRandomizedSizes(true);
        // TODO: Add color. It's currently messing up
        //fizz.setColor(Color.ORANGE.getRed(), Color.ORANGE.getGreen(), Color.ORANGE.getBlue());
        fizz.setMotion(0, ThreadLocalRandom.current().nextDouble(0.10, 0.30), 0);
        fizz.randomDirection(0.1, 0, 0.1);
        fizz.jitter(10, 0.2, 0.2, 0.2);
        fizz.setRandomizedSizes(true);
    }
    return true;
}

[Buggy Hunk]
if (smelted != null)

[Patch]
if (!caster.worldObj.isRemote && smelted != null)

[Demonstration 2]

[Buggy Method]
@SubscribeEvent(priority = EventPriority.LOWEST)
public void entityDropEvent(LivingDropsEvent e) {
    if (e.getEntity() instanceof EntityPlayer && e.getResult() != Event.Result.DENY && !e.getEntity().getEntityWorld().isRemote) {
        final EntityPlayer player = (EntityPlayer) e.getEntity();
        if (player.isSpectator())
            return;
        final World w = player.getEntityWorld();
        Map<ItemStack, EntityEquipmentSlot> cache = equipmentCache.computeIfAbsent(player, (EntityPlayer p) -> new HashMap<>());
        EntityLootableBody corpse = new EntityLootableBody(player);
        corpse.forceSpawn = true;
        corpse.setUserName(player.getName());
        corpse.setRotation(player.rotationYaw);
        NonNullList<ItemStack> items = NonNullList.<ItemStack>create();
        for (EntityItem itemEntity : e.getDrops()) {
            ItemStack item = itemEntity.getEntityItem();
            if (!item.isEmpty() && cache.containsKey(item)) {
                corpse.setItemStackToSlot(cache.get(item), item);
            } else if (!item.isEmpty()) {
                items.add(item);
            }
        }
        corpse.initializeItems(items);
        if (LootableBodies.addBonesToCorpse) {
            corpse.addItem(new ItemStack(Items.BONE, 1 + w.rand.nextInt(3)));
            corpse.addItem(new ItemStack(Items.ROTTEN_FLESH, 1 + w.rand.nextInt(3)));
        }
        w.spawnEntity(corpse);
        e.getDrops().clear();
    }
}

[Buggy Hunk]
ItemStack item = itemEntity.getEntityItem();

[Patch]
ItemStack item = itemEntity.getItem();

[Demonstration 3]

[Buggy Method]
public void run() {
    double currentTime = 0;
    CellIndexMethod method = new CellIndexMethod(this.L, 2 * this.D / 5, false);
    int iteration = 0;
    while (currentTime < tf) {
        method.load(new HashSet<>(this.particles));
        Map<Particle, Set<Particle>> neighbors = method.findNeighbors();
        List<Particle> nextGen = new ArrayList<>();
        neighbors = filterNeighbors(neighbors);
        addWallParticles(neighbors);
        for (Particle particle : particles) {
            Particle p = integralMethod.moveParticle(particle, neighbors.get(particle));
            nextGen.add(p);
        }
        if (Math.abs(currentTime / dt2 - Math.round(currentTime / dt2)) < EPSILON)
            printOvitoState(iteration);
        this.particles = nextGen;
        currentTime += dt;
        iteration++;
    }
}

[Buggy Hunk]
CellIndexMethod method = new CellIndexMethod(this.L, 2 * this.D / 5, false);

[Patch]
CellIndexMethod method = new CellIndexMethod(this.L, this.D / 5, false);