if (checkPotion(event.getContents().getItem(i))) alreadyExistingTemp++;
@Override public void run() { // unfinaling it for modifications boolean brewed = false; int alreadyExistingFinal = alreadyExisting; for (int i = 0; i < 3; i++) { // if there were any potions before, don't count them to // prevent cheating if (checkPotion(event.getContents().getItem(i))) { if (alreadyExistingFinal <= 0 && checkConditions(playerID)) { data.brew(); } alreadyExistingFinal--; brewed = true; } } // check if the objective has been completed if (data.getAmount() >= amount) { completeObjective(playerID); } else if (brewed && notify && data.getAmount() % notifyInterval == 0) { Config.sendMessage(playerID, "potions_to_brew", new String[] { String.valueOf(amount - data.getAmount()) }); } } }.runTask(BetonQuest.getInstance());