diff --git a/pom.xml b/pom.xml index bf5685c82..94a79cc2d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 2.9.3 + 2.9.4 quests https://github.com/FlyingPikachu/Quests/ jar diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index 1644e7bab..c43c20017 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -362,9 +362,9 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksDamaged) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { - unfinishedObjectives.add(ChatColor.GREEN + Lang.get("damage") + " " + Items.itemByStack(e2).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); + unfinishedObjectives.add(ChatColor.GREEN + Lang.get("damage") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("damage") + " " + Items.itemByStack(e2).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); + finishedObjectives.add(ChatColor.GRAY + Lang.get("damage") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); } } } @@ -373,9 +373,9 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksBroken) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { - unfinishedObjectives.add(ChatColor.GREEN + Lang.get("break") + " " + Items.itemByStack(e2).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); + unfinishedObjectives.add(ChatColor.GREEN + Lang.get("break") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("break") + " " + Items.itemByStack(e2).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); + finishedObjectives.add(ChatColor.GRAY + Lang.get("break") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); } } } @@ -384,9 +384,9 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksPlaced) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { - unfinishedObjectives.add(ChatColor.GREEN + Lang.get("place") + " " + Items.itemByStack(e2).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); + unfinishedObjectives.add(ChatColor.GREEN + Lang.get("place") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("place") + " " + Items.itemByStack(e2).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); + finishedObjectives.add(ChatColor.GRAY + Lang.get("place") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); } } } @@ -395,9 +395,9 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksUsed) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { - unfinishedObjectives.add(ChatColor.GREEN + Lang.get("use") + " " + Items.itemByStack(e2).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); + unfinishedObjectives.add(ChatColor.GREEN + Lang.get("use") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("use") + " " + Items.itemByStack(e2).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); + finishedObjectives.add(ChatColor.GRAY + Lang.get("use") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); } } } @@ -406,9 +406,9 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksCut) { if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { - unfinishedObjectives.add(ChatColor.GREEN + Lang.get("cut") + " " + Items.itemByStack(e2).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); + unfinishedObjectives.add(ChatColor.GREEN + Lang.get("cut") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GREEN + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("cut") + " " + Items.itemByStack(e2).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); + finishedObjectives.add(ChatColor.GRAY + Lang.get("cut") + " " + Items.itemByType(e2.getType()).getName() + ChatColor.GRAY + ": " + e2.getAmount() + "/" + e.getAmount()); } } } @@ -1495,7 +1495,7 @@ public class Quester { return capitalized; } - // TODO eliminate and replace all with Items.itemByStack(is).getName() + // TODO eliminate and replace all with Items.itemByType(is.getType()).getName() public static String prettyItemString(String itemName) { String baseString = Material.matchMaterial(itemName).toString(); String[] substrings = baseString.split("_"); @@ -2516,10 +2516,10 @@ public class Quester { if (!meta.hasLore()) { LinkedList lines = new LinkedList(); String desc = quests.get(i).description; - if (desc == ChatColor.stripColor(quests.get(i).description)) { - lines = MiscUtil.makeLines(quests.get(i).description, " ", 40, ChatColor.DARK_GREEN); + if (desc == ChatColor.stripColor(desc)) { + lines = MiscUtil.makeLines(desc, " ", 40, ChatColor.DARK_GREEN); } else { - lines = MiscUtil.makeLines(quests.get(i).description, " ", 40, null); + lines = MiscUtil.makeLines(desc, " ", 40, null); } meta.setLore(lines); }