diff --git a/main/src/main/java/me/blackvein/quests/Quester.java b/main/src/main/java/me/blackvein/quests/Quester.java index 9390eee05..630ff8c51 100644 --- a/main/src/main/java/me/blackvein/quests/Quester.java +++ b/main/src/main/java/me/blackvein/quests/Quester.java @@ -1082,7 +1082,7 @@ public class Quester { final ItemStack finalToBreak = toBreak; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).blocksBroken.set(getQuestData(quest).blocksBroken.indexOf(finalBroken), newBroken); - q.finishObjective(quest, "breakBlock", m, finalToBreak, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "breakBlockMulti", m, finalToBreak, null, null, null, null, null, null, null, null); return null; }); } @@ -1147,7 +1147,7 @@ public class Quester { final ItemStack finalToDamage = toDamage; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).blocksDamaged.set(getQuestData(quest).blocksDamaged.indexOf(finalDamaged), newDamaged); - q.finishObjective(quest, "damageBlock", m, finalToDamage, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "damageBlockMulti", m, finalToDamage, null, null, null, null, null, null, null, null); return null; }); } @@ -1212,7 +1212,7 @@ public class Quester { final ItemStack finalToPlace = toPlace; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).blocksPlaced.set(getQuestData(quest).blocksPlaced.indexOf(finalPlaced), newplaced); - q.finishObjective(quest, "damageBlock", m, finalToPlace, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "placeBlockMulti", m, finalToPlace, null, null, null, null, null, null, null, null); return null; }); } @@ -1277,7 +1277,7 @@ public class Quester { final ItemStack finalToUse = toUse; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).blocksUsed.set(getQuestData(quest).blocksUsed.indexOf(finalUsed), newUsed); - q.finishObjective(quest, "useBlock", m, finalToUse, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "useBlockMulti", m, finalToUse, null, null, null, null, null, null, null, null); return null; }); } @@ -1342,7 +1342,7 @@ public class Quester { final ItemStack finalToCut = toCut; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).blocksCut.set(getQuestData(quest).blocksCut.indexOf(finalCut), newCut); - q.finishObjective(quest, "cutBlock", m, finalToCut, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "cutBlockMulti", m, finalToCut, null, null, null, null, null, null, null, null); return null; }); } @@ -1385,7 +1385,7 @@ public class Quester { final ItemStack finalFound = found; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsCrafted.put(finalFound, req); - q.finishObjective(quest, "craftItem", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "craftItemMulti", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); return null; }); } else { @@ -1430,7 +1430,7 @@ public class Quester { final ItemStack finalFound = found; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsSmelted.put(finalFound, req); - q.finishObjective(quest, "smeltItem", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "smeltItemMulti", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); return null; }); } else { @@ -1463,7 +1463,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsEnchanted.put(entry.getKey(), num); - q.finishObjective(quest, "enchantItem", new ItemStack(m, 1), finalToEnchant, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "enchantItemMulti", new ItemStack(m, 1), finalToEnchant, null, null, null, null, null, null, null, null); return null; }); } @@ -1511,7 +1511,7 @@ public class Quester { final ItemStack finalFound = found; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsBrewed.put(finalFound, req); - q.finishObjective(quest, "brewItem", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "brewItemMulti", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); return null; }); } else { @@ -1536,7 +1536,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).setFishCaught(getQuestData(quest).getFishCaught()); - q.finishObjective(quest, "catchFish", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, fishToCatch), null, null, null, null, null, null, null, null); + q.finishObjective(quest, "catchFishMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, fishToCatch), null, null, null, null, null, null, null, null); return null; }); } @@ -1589,7 +1589,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, currentStage, (Quester q) -> { - q.finishObjective(quest, "killMob", new ItemStack(Material.AIR, 1), + q.finishObjective(quest, "killMobMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, numberOfSpecificMobNeedsToBeKilledInCurrentStage), null, e, null, null, null, null, null, null); //q.getQuestData(quest).mobNumKilled.set(indexOfMobKilled, newNumberOfSpecificMobKilled); return null; @@ -1614,7 +1614,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).setPlayersKilled(getQuestData(quest).getPlayersKilled()); - q.finishObjective(quest, "killPlayer", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, playersToKill), null, null, null, null, null, null, null, null); + q.finishObjective(quest, "killPlayerMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, playersToKill), null, null, null, null, null, null, null, null); return null; }); } @@ -1672,7 +1672,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsDelivered.put(found, req); - q.finishObjective(quest, "deliverItem", new ItemStack(m, 1), found, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "deliverItemMulti", new ItemStack(m, 1), found, null, null, null, null, null, null, null, null); return null; }); } else { @@ -1733,7 +1733,7 @@ public class Quester { final ItemStack finalFound = found; dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).itemsDelivered.put(finalFound, req); - q.finishObjective(quest, "deliverItem", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); + q.finishObjective(quest, "deliverItemMulti", new ItemStack(m, 1), finalFound, null, null, null, null, null, null, null, null); return null; }); } else { @@ -1765,7 +1765,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).citizensInteracted.put(n.getId(), true); - q.finishObjective(quest, "talkToNPC", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, n, null, null, null, null); + q.finishObjective(quest, "talkToNPCMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, n, null, null, null, null); return null; }); } @@ -1790,7 +1790,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).citizenNumKilled.set(index, getQuestData(quest).citizenNumKilled.get(index)); - q.finishObjective(quest, "killNPC", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, npcsToKill), null, null, null, n, null, null, null, null); + q.finishObjective(quest, "killNPCMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, npcsToKill), null, null, null, n, null, null, null, null); return null; }); } @@ -1839,7 +1839,7 @@ public class Quester { } else { q.getQuestData(quest).hasReached.set(finalIndex, true); }*/ - q.finishObjective(quest, "reachLocation", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, null, location, null, null, null); + q.finishObjective(quest, "reachLocationMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, null, location, null, null, null); return null; }); } @@ -1875,7 +1875,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).mobsTamed.put(entity, getQuestData(quest).mobsTamed.get(entity)); - q.finishObjective(quest, "tameMob", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, mobsToTame), null, entity, null, null, null, null, null, null); + q.finishObjective(quest, "tameMobMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, mobsToTame), null, entity, null, null, null, null, null, null); return null; }); } @@ -1898,7 +1898,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).sheepSheared.put(color, getQuestData(quest).sheepSheared.get(color)); - q.finishObjective(quest, "shearSheep", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, sheepToShear), null, null, null, null, null, color, null, null); + q.finishObjective(quest, "shearSheepMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, sheepToShear), null, null, null, null, null, color, null, null); return null; }); } @@ -1927,7 +1927,7 @@ public class Quester { // Multiplayer dispatchMultiplayerEventShareObjective(quest, getCurrentStage(quest), (Quester q) -> { //q.getQuestData(quest).passwordsSaid.put(display, true); - q.finishObjective(quest, "password", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, null, null, null, display, null); + q.finishObjective(quest, "passwordMulti", new ItemStack(Material.AIR, 1), new ItemStack(Material.AIR, 1), null, null, null, null, null, null, display, null); return null; }); }); @@ -1975,10 +1975,10 @@ public class Quester { if (getCurrentStage(quest).objectiveOverride != null) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + getCurrentStage(quest).objectiveOverride; p.sendMessage(message); - } else if (objective.equalsIgnoreCase("password")) { + } else if (objective.startsWith("password")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + pass; p.sendMessage(message); - } else if (objective.equalsIgnoreCase("breakBlock")) { + } else if (objective.startsWith("breakBlock")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "break") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta() && !increment.getItemMeta().hasDisplayName()) { @@ -1986,7 +1986,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(increment))); } - } else if (objective.equalsIgnoreCase("damageBlock")) { + } else if (objective.startsWith("damageBlock")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "damage") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta() && !increment.getItemMeta().hasDisplayName()) { @@ -1994,7 +1994,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(increment))); } - } else if (objective.equalsIgnoreCase("placeBlock")) { + } else if (objective.startsWith("placeBlock")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "place") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta() && !increment.getItemMeta().hasDisplayName()) { @@ -2002,7 +2002,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(increment))); } - } else if (objective.equalsIgnoreCase("useBlock")) { + } else if (objective.startsWith("useBlock")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "use") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta() && !increment.getItemMeta().hasDisplayName()) { @@ -2010,7 +2010,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(increment))); } - } else if (objective.equalsIgnoreCase("cutBlock")) { + } else if (objective.startsWith("cutBlock")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "cut") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta() && !increment.getItemMeta().hasDisplayName()) { @@ -2018,7 +2018,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(increment))); } - } else if (objective.equalsIgnoreCase("craftItem")) { + } else if (objective.startsWith("craftItem")) { ItemStack is = getCurrentStage(quest).itemsToCraft.get(getCurrentStage(quest).itemsToCraft.indexOf(goal)); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "craft") + " " + is.getAmount() + "/" + is.getAmount(); @@ -2027,7 +2027,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(is))); } - } else if (objective.equalsIgnoreCase("smeltItem")) { + } else if (objective.startsWith("smeltItem")) { ItemStack is = getCurrentStage(quest).itemsToSmelt.get(getCurrentStage(quest).itemsToSmelt.indexOf(goal)); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "smelt") + " " + is.getAmount() + "/" + is.getAmount(); @@ -2036,7 +2036,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(is))); } - } else if (objective.equalsIgnoreCase("enchantItem")) { + } else if (objective.startsWith("enchantItem")) { String obj = Lang.get(p, "enchantItem"); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj; Map ench = new HashMap(); @@ -2053,7 +2053,7 @@ public class Quester { p.sendMessage(message.replace("", ItemUtil.getName(increment)) .replace("", enchantment.getName())); } - } else if (objective.equalsIgnoreCase("brewItem")) { + } else if (objective.startsWith("brewItem")) { ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal)); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brew") + " " + is.getAmount() + "/" + is.getAmount(); @@ -2062,7 +2062,7 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(is))); } - } else if (objective.equalsIgnoreCase("deliverItem")) { + } else if (objective.startsWith("deliverItem")) { String obj = Lang.get(p, "deliver"); obj = obj.replace("", plugin.getNPCName(getCurrentStage(quest).itemDeliveryTargets.get(getCurrentStage(quest).itemsToDeliver.indexOf(goal)))); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj; @@ -2072,11 +2072,11 @@ public class Quester { } else { p.sendMessage(message.replace("", ItemUtil.getName(is))); } - } else if (objective.equalsIgnoreCase("catchFish")) { + } else if (objective.startsWith("catchFish")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "catchFish") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); p.sendMessage(message); - } else if (objective.equalsIgnoreCase("killMob")) { + } else if (objective.startsWith("killMob")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems()) { @@ -2084,20 +2084,20 @@ public class Quester { } else { p.sendMessage(message.replace("", MiscUtil.getProperMobName(mob))); } - } else if (objective.equalsIgnoreCase("killPlayer")) { + } else if (objective.startsWith("killPlayer")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "killPlayer"); message = message + " " + goal.getAmount() + "/" + goal.getAmount(); p.sendMessage(message); - } else if (objective.equalsIgnoreCase("talkToNPC")) { + } else if (objective.startsWith("talkToNPC")) { String obj = Lang.get(p, "talkTo"); obj = obj.replace("", plugin.getNPCName(npc.getId())); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj; p.sendMessage(message); - } else if (objective.equalsIgnoreCase("killNPC")) { + } else if (objective.startsWith("killNPC")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill") + " " + npc.getName(); message = message + " " + goal.getAmount() + "/" + goal.getAmount(); p.sendMessage(message); - } else if (objective.equalsIgnoreCase("tameMob")) { + } else if (objective.startsWith("tameMob")) { String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "tame") + " "; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); if (plugin.getSettings().canTranslateItems()) { @@ -2105,13 +2105,13 @@ public class Quester { } else { p.sendMessage(message.replace("", MiscUtil.getProperMobName(mob))); } - } else if (objective.equalsIgnoreCase("shearSheep")) { + } else if (objective.startsWith("shearSheep")) { String obj = Lang.get(p, "shearSheep"); obj = obj.replace("", color.name().toLowerCase()); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj; message = message + " " + goal.getAmount() + "/" + goal.getAmount(); p.sendMessage(message); - } else if (objective.equalsIgnoreCase("reachLocation")) { + } else if (objective.startsWith("reachLocation")) { String obj = Lang.get(p, "goTo"); obj = obj.replace("", getCurrentStage(quest).locationNames.get(getCurrentStage(quest).locationsToReach.indexOf(location))); String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj; @@ -2138,7 +2138,7 @@ public class Quester { } p.sendMessage(message); } - if (testComplete(quest)) { + if (testComplete(quest) || objective.contains("Multi")) { quest.nextStage(this, true); } }