[Demonstration 1]

[Buggy Method]
@Override
public void run() {
    if (BetterOntime.instance != null && BetterOntime.instance.ds != null) {
        for (Player player : BetterOntime.instance.getServer().getOnlinePlayers()) {
            UUID uuid = UUIDProvider.get(player);
            if (uuid != null) {
                PlayerStats stats = BetterOntime.instance.ds.getPlayerStats(uuid);
                if (stats != null) {
                    if (stats.lastEpochTime == 0) {
                        stats.lastEpochTime = DataStore.epoch();
                    }
                    int timeToAdd = DataStore.epoch() - stats.lastEpochTime;
                    if (timeToAdd > 60) {
                        // DEBUG
                        BetterOntime.instance.getLogger().info("BOTWARNING " + player.getName() + " timeToAdd " + timeToAdd + " -> " + DataStore.epoch() + "-" + stats.lastEpochTime);
                        BetterOntime.instance.getServer().dispatchCommand(BetterOntime.instance.getServer().getConsoleSender(), "w KaiNoMood BW " + BetterOntime.instance.config.serverId + " " + player.getName() + " add " + timeToAdd + " | " + DataStore.epoch() + "-" + stats.lastEpochTime);
                        timeToAdd = 30;
                    }
                    BetterOntime.instance.ds.addTime(uuid, timeToAdd);
                    boolean executedCommand = false;
                    for (StoredCommand command : BetterOntime.instance.ds.commands) {
                        if (isTimeToRunCommand(command, stats) && !player.hasPermission("betterontime.exclude." + command.id) && !player.hasPermission("betterontime.exclude.all")) {
                            String commandToRun = command.command.replace("{p.name}", player.getName()).replace("{p.uuid}", uuid.toString());
                            try {
                                BetterOntime.instance.getLogger().info("Run command id " + command.id + ": " + commandToRun);
                                BetterOntime.instance.getServer().dispatchCommand(BetterOntime.instance.getServer().getConsoleSender(), commandToRun);
                                executedCommand = true;
                            } catch (CommandException e) {
                                BetterOntime.instance.getLogger().info("An error occurred while running command id " + command.id + ": " + commandToRun);
                                e.printStackTrace();
                            }
                        }
                    }
                    if (executedCommand) {
                        BetterOntime.instance.ds.setLastExecutedCommand(uuid, stats.global, BetterOntime.instance.config.serverId);
                    } else {
                        stats.lastGlobalCheck = stats.global;
                    }
                }
            }
        }
    }
}

[Buggy Hunk]
if (executedCommand) {

[Patch]
if (executedCommand || stats.lastGlobalCheck+600<stats.global) {

[Demonstration 2]

[Buggy Method]
private void receiveDisconnect(ChannelHandlerContext ctx) {
    System.out.println("disconnect");
    Player pl = Main.I.getPlayer(ctx);
    if (pl == null)
        ctx.close();
    pl.receiveDisconnect();
}

[Buggy Hunk]
pl.receiveDisconnect();

[Patch]
else pl.receiveDisconnect();

[Demonstration 3]

[Buggy Method]
private void checkplmove() {
    Gob pl;
    long now = System.currentTimeMillis();
    if ((playergob >= 0) && ((pl = glob.oc.getgob(playergob)) != null) && (pl.sc != null)) {
        Coord plp = pl.getc();
        if ((plfpos == null) || !plfpos.equals(plp)) {
            lastmove = now;
            plfpos = plp;
            if ((obscpart != null) && !obscpart.checkhit(pl.sc.add(obscgob.sc.inv()))) {
                obscpart = null;
                obscgob = null;
            }
        } else if (now - lastmove > 500) {
            for (Sprite.Part p : clickable) {
                Gob gob = (Gob) p.owner;
                if ((gob == null) || (gob.sc == null))
                    continue;
                if (gob == pl)
                    break;
                if (p.checkhit(pl.sc.add(gob.sc.inv()))) {
                    obscpart = p;
                    obscgob = gob;
                    break;
                }
            }
        }
    }
    player_moving = ((now - lastmove) < 400);
}

[Buggy Hunk]
if((playergob >= 0) && ((pl = glob.oc.getgob(playergob)) != null) && (pl.sc != null)) {

[Patch]
if((playergob != -1) && ((pl = glob.oc.getgob(playergob)) != null) && (pl.sc != null)) {