diff --git a/main/src/main/java/me/blackvein/quests/QuestFactory.java b/main/src/main/java/me/blackvein/quests/QuestFactory.java index 468711e59..b79eba2bb 100644 --- a/main/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/main/src/main/java/me/blackvein/quests/QuestFactory.java @@ -984,19 +984,19 @@ public class QuestFactory implements ConversationAbandonedListener { ConfigurationSection stages = cs.createSection("stages"); ConfigurationSection ordered = stages.createSection("ordered"); String pref; - LinkedList breakIds; + LinkedList breakNames; LinkedList breakAmounts; LinkedList breakDurability; - LinkedList damageIds; + LinkedList damageNames; LinkedList damageAmounts; LinkedList damageDurability; - LinkedList placeIds; + LinkedList placeNames; LinkedList placeAmounts; LinkedList placeDurability; - LinkedList useIds; + LinkedList useNames; LinkedList useAmounts; LinkedList useDurability; - LinkedList cutIds; + LinkedList cutNames; LinkedList cutAmounts; LinkedList cutDurability; LinkedList deliveryItems; @@ -1046,19 +1046,19 @@ public class QuestFactory implements ConversationAbandonedListener { for (int i = 1; i <= StagesPrompt.getStages(cc); i++) { pref = "stage" + i; ConfigurationSection stage = ordered.createSection("" + i); - breakIds = null; + breakNames = null; breakAmounts = null; breakDurability = null; - damageIds = null; + damageNames = null; damageAmounts = null; damageDurability = null; - placeIds = null; + placeNames = null; placeAmounts = null; placeDurability = null; - useIds = null; + useNames = null; useAmounts = null; useDurability = null; - cutIds = null; + cutNames = null; cutAmounts = null; cutDurability = null; craftItems = null; @@ -1106,27 +1106,27 @@ public class QuestFactory implements ConversationAbandonedListener { startMessage = null; completeMessage = null; if (cc.getSessionData(pref + CK.S_BREAK_NAMES) != null) { - breakIds = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_NAMES); + breakNames = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_NAMES); breakAmounts = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_AMOUNTS); breakDurability = (LinkedList) cc.getSessionData(pref + CK.S_BREAK_DURABILITY); } if (cc.getSessionData(pref + CK.S_DAMAGE_NAMES) != null) { - damageIds = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_NAMES); + damageNames = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_NAMES); damageAmounts = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_AMOUNTS); damageDurability = (LinkedList) cc.getSessionData(pref + CK.S_DAMAGE_DURABILITY); } if (cc.getSessionData(pref + CK.S_PLACE_NAMES) != null) { - placeIds = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_NAMES); + placeNames = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_NAMES); placeAmounts = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_AMOUNTS); placeDurability = (LinkedList) cc.getSessionData(pref + CK.S_PLACE_DURABILITY); } if (cc.getSessionData(pref + CK.S_USE_NAMES) != null) { - useIds = (LinkedList) cc.getSessionData(pref + CK.S_USE_NAMES); + useNames = (LinkedList) cc.getSessionData(pref + CK.S_USE_NAMES); useAmounts = (LinkedList) cc.getSessionData(pref + CK.S_USE_AMOUNTS); useDurability = (LinkedList) cc.getSessionData(pref + CK.S_USE_DURABILITY); } if (cc.getSessionData(pref + CK.S_CUT_NAMES) != null) { - cutIds = (LinkedList) cc.getSessionData(pref + CK.S_CUT_NAMES); + cutNames = (LinkedList) cc.getSessionData(pref + CK.S_CUT_NAMES); cutAmounts = (LinkedList) cc.getSessionData(pref + CK.S_CUT_AMOUNTS); cutDurability = (LinkedList) cc.getSessionData(pref + CK.S_CUT_DURABILITY); } @@ -1226,28 +1226,28 @@ public class QuestFactory implements ConversationAbandonedListener { if (cc.getSessionData(pref + CK.S_COMPLETE_MESSAGE) != null) { completeMessage = (String) cc.getSessionData(pref + CK.S_COMPLETE_MESSAGE); } - if (breakIds != null && breakIds.isEmpty() == false) { - stage.set("break-block-names", breakIds); + if (breakNames != null && breakNames.isEmpty() == false) { + stage.set("break-block-names", breakNames); stage.set("break-block-amounts", breakAmounts); stage.set("break-block-durability", breakDurability); } - if (damageIds != null && damageIds.isEmpty() == false) { - stage.set("damage-block-names", damageIds); + if (damageNames != null && damageNames.isEmpty() == false) { + stage.set("damage-block-names", damageNames); stage.set("damage-block-amounts", damageAmounts); stage.set("damage-block-durability", damageDurability); } - if (placeIds != null && placeIds.isEmpty() == false) { - stage.set("place-block-names", placeIds); + if (placeNames != null && placeNames.isEmpty() == false) { + stage.set("place-block-names", placeNames); stage.set("place-block-amounts", placeAmounts); stage.set("place-block-durability", placeDurability); } - if (useIds != null && useIds.isEmpty() == false) { - stage.set("use-block-names", useIds); + if (useNames != null && useNames.isEmpty() == false) { + stage.set("use-block-names", useNames); stage.set("use-block-amounts", useAmounts); stage.set("use-block-durability", useDurability); } - if (cutIds != null && cutIds.isEmpty() == false) { - stage.set("cut-block-names", cutIds); + if (cutNames != null && cutNames.isEmpty() == false) { + stage.set("cut-block-names", cutNames); stage.set("cut-block-amounts", cutAmounts); stage.set("cut-block-durability", cutDurability); } diff --git a/main/src/main/java/me/blackvein/quests/Quests.java b/main/src/main/java/me/blackvein/quests/Quests.java index 61a4e5435..81cb9d6e8 100644 --- a/main/src/main/java/me/blackvein/quests/Quests.java +++ b/main/src/main/java/me/blackvein/quests/Quests.java @@ -1851,21 +1851,21 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener ConfigurationSection questStages = config.getConfigurationSection("quests." + questKey + ".stages.ordered"); for (String s2 : questStages.getKeys(false)) { Stage oStage = new Stage(); - List breaknames = new LinkedList(); - List breakamounts = new LinkedList(); - List breakdurability = new LinkedList(); - List damagenames = new LinkedList(); - List damageamounts = new LinkedList(); - List damagedurability = new LinkedList(); - List placenames = new LinkedList(); - List placeamounts = new LinkedList(); - List placedurability = new LinkedList(); - List usenames = new LinkedList(); - List useamounts = new LinkedList(); - List usedurability = new LinkedList(); - List cutnames = new LinkedList(); - List cutamounts = new LinkedList(); - List cutdurability = new LinkedList(); + List breakNames = new LinkedList(); + List breakAmounts = new LinkedList(); + List breakDurability = new LinkedList(); + List damageNames = new LinkedList(); + List damageAmounts = new LinkedList(); + List damageDurability = new LinkedList(); + List placeNames = new LinkedList(); + List placeAmounts = new LinkedList(); + List placeDurability = new LinkedList(); + List useNames = new LinkedList(); + List useAmounts = new LinkedList(); + List useDurability = new LinkedList(); + List cutNames = new LinkedList(); + List cutAmounts = new LinkedList(); + List cutDurability = new LinkedList(); List mobsToKill = new LinkedList(); List mobNumToKill = new LinkedList(); List locationsToKillWithin = new LinkedList(); @@ -1893,13 +1893,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".break-block-names")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-names"), String.class)) { - breaknames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-names"); + breakNames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-names"); } else { stageFailed("break-block-names: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of strings!"); } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".break-block-amounts")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-amounts"), Integer.class)) { - breakamounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-amounts"); + breakAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-amounts"); } else { stageFailed("break-block-amounts: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1908,7 +1908,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".break-block-durability")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-durability"), Integer.class)) { - breakdurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-durability"); + breakDurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".break-block-durability"); } else { stageFailed("break-block-durability: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1917,13 +1917,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } int breakIndex = 0; - for (String s : breaknames) { + for (String s : breakNames) { ItemStack is; - if (breakdurability.get(breakIndex) != -1) { - is = ItemUtil.processItemStack(s, breakamounts.get(breakIndex), breakdurability.get(breakIndex)); + if (breakDurability.get(breakIndex) != -1) { + is = ItemUtil.processItemStack(s, breakAmounts.get(breakIndex), breakDurability.get(breakIndex)); } else { // Legacy - is = ItemUtil.processItemStack(s, breakamounts.get(breakIndex), (short) 0); + is = ItemUtil.processItemStack(s, breakAmounts.get(breakIndex), (short) 0); } if (Material.matchMaterial(s) != null) { oStage.blocksToBreak.add(is); @@ -1934,13 +1934,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-names")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-names"), String.class)) { - damagenames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-names"); + damageNames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-names"); } else { stageFailed("damage-block-names: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of strings!"); } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-amounts")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-amounts"), Integer.class)) { - damageamounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-amounts"); + damageAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-amounts"); } else { stageFailed("damage-block-amounts: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1949,7 +1949,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-durability")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-durability"), Integer.class)) { - damagedurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-durability"); + damageDurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".damage-block-durability"); } else { stageFailed("damage-block-durability: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1958,13 +1958,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } int damageIndex = 0; - for (String s : damagenames) { + for (String s : damageNames) { ItemStack is; - if (damagedurability.get(damageIndex) != -1) { - is = ItemUtil.processItemStack(s, damageamounts.get(damageIndex), damagedurability.get(damageIndex)); + if (damageDurability.get(damageIndex) != -1) { + is = ItemUtil.processItemStack(s, damageAmounts.get(damageIndex), damageDurability.get(damageIndex)); } else { // Legacy - is = ItemUtil.processItemStack(s, damageamounts.get(damageIndex), (short) 0); + is = ItemUtil.processItemStack(s, damageAmounts.get(damageIndex), (short) 0); } if (Material.matchMaterial(s) != null) { oStage.blocksToDamage.add(is); @@ -1975,13 +1975,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".place-block-names")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-names"), String.class)) { - placenames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-names"); + placeNames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-names"); } else { stageFailed("place-block-names: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of strings!"); } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".place-block-amounts")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-amounts"), Integer.class)) { - placeamounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-amounts"); + placeAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-amounts"); } else { stageFailed("place-block-amounts: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1990,7 +1990,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".place-block-durability")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-durability"), Integer.class)) { - placedurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-durability"); + placeDurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".place-block-durability"); } else { stageFailed("place-block-durability: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -1999,13 +1999,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } int placeIndex = 0; - for (String s : placenames) { + for (String s : placeNames) { ItemStack is; - if (placedurability.get(placeIndex) != -1) { - is = ItemUtil.processItemStack(s, placeamounts.get(placeIndex), placedurability.get(placeIndex)); + if (placeDurability.get(placeIndex) != -1) { + is = ItemUtil.processItemStack(s, placeAmounts.get(placeIndex), placeDurability.get(placeIndex)); } else { // Legacy - is = ItemUtil.processItemStack(s, placeamounts.get(placeIndex), (short) 0); + is = ItemUtil.processItemStack(s, placeAmounts.get(placeIndex), (short) 0); } if (Material.matchMaterial(s) != null) { oStage.blocksToPlace.add(is); @@ -2016,13 +2016,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".use-block-names")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-names"), String.class)) { - usenames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-names"); + useNames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-names"); } else { stageFailed("use-block-names: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of strings!"); } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".use-block-amounts")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-amounts"), Integer.class)) { - useamounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-amounts"); + useAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-amounts"); } else { stageFailed("use-block-amounts: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -2031,7 +2031,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".use-block-durability")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-durability"), Integer.class)) { - usedurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-durability"); + useDurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".use-block-durability"); } else { stageFailed("use-block-durability: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -2040,13 +2040,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } int useIndex = 0; - for (String s : usenames) { + for (String s : useNames) { ItemStack is; - if (usedurability.get(useIndex) != -1) { - is = ItemUtil.processItemStack(s, useamounts.get(useIndex), usedurability.get(useIndex)); + if (useDurability.get(useIndex) != -1) { + is = ItemUtil.processItemStack(s, useAmounts.get(useIndex), useDurability.get(useIndex)); } else { // Legacy - is = ItemUtil.processItemStack(s, useamounts.get(useIndex), (short) 0); + is = ItemUtil.processItemStack(s, useAmounts.get(useIndex), (short) 0); } if (Material.matchMaterial(s) != null) { oStage.blocksToUse.add(is); @@ -2057,13 +2057,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-names")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-names"), String.class)) { - cutnames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-names"); + cutNames = config.getStringList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-names"); } else { stageFailed("cut-block-names: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of strings!"); } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-amounts")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-amounts"), Integer.class)) { - cutamounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-amounts"); + cutAmounts = config.getIntegerList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-amounts"); } else { stageFailed("cut-block-amounts: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -2072,7 +2072,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } if (config.contains("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-durability")) { if (checkList(config.getList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-durability"), Integer.class)) { - cutdurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-durability"); + cutDurability = config.getShortList("quests." + questKey + ".stages.ordered." + s2 + ".cut-block-durability"); } else { stageFailed("cut-block-durability: in Stage " + s2 + " of Quest " + quest.getName() + " is not a list of numbers!"); } @@ -2081,13 +2081,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener } } int cutIndex = 0; - for (String s : cutnames) { + for (String s : cutNames) { ItemStack is; - if (cutdurability.get(cutIndex) != -1) { - is = ItemUtil.processItemStack(s, cutamounts.get(cutIndex), cutdurability.get(cutIndex)); + if (cutDurability.get(cutIndex) != -1) { + is = ItemUtil.processItemStack(s, cutAmounts.get(cutIndex), cutDurability.get(cutIndex)); } else { // Legacy - is = ItemUtil.processItemStack(s, cutamounts.get(cutIndex), (short) 0); + is = ItemUtil.processItemStack(s, cutAmounts.get(cutIndex), (short) 0); } if (Material.matchMaterial(s) != null) { oStage.blocksToCut.add(is);