diff --git a/pom.xml b/pom.xml index 1d51c91a1..a304656bf 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ me.blackvein.quests quests - 2.7.1 + 2.7.2 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 1b8f9997c..cbb4da162 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -432,7 +432,7 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksDamaged) { - if (e2.getType().equals(e.getType())) { + if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { @@ -453,15 +453,14 @@ public class Quester { for (ItemStack e : getCurrentStage(quest).blocksToBreak) { for (ItemStack e2 : getQuestData(quest).blocksBroken) { - - if (e2.getType().equals(e.getType())) { + + 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() + ": " + e2.getAmount() + "/" + e.getAmount()); } else { - finishedObjectives.add(ChatColor.GRAY + Lang.get("break") + " " + Items.itemByStack(e2).getName() + ": " + e2.getAmount() + "/" + e.getAmount()); } @@ -476,7 +475,7 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksPlaced) { - if (e2.getType().equals(e.getType())) { + if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { @@ -498,7 +497,7 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksUsed) { - if (e2.getType().equals(e.getType())) { + if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { @@ -520,7 +519,7 @@ public class Quester { for (ItemStack e2 : getQuestData(quest).blocksCut) { - if (e2.getType().equals(e.getType())) { + if (e2.getType().equals(e.getType()) && e2.getDurability() == e.getDurability()) { if (e2.getAmount() < e.getAmount()) { @@ -2046,6 +2045,8 @@ Material m = null; return capitalized; } + + //TODO eliminate and replace all with Items.itemByStack(is).getName() public static String prettyItemString(String itemName) { String baseString = Material.matchMaterial(itemName).toString(); String[] substrings = baseString.split("_"); diff --git a/src/main/java/me/blackvein/quests/util/ItemUtil.java b/src/main/java/me/blackvein/quests/util/ItemUtil.java index 64783a8b0..a8a0c556b 100644 --- a/src/main/java/me/blackvein/quests/util/ItemUtil.java +++ b/src/main/java/me/blackvein/quests/util/ItemUtil.java @@ -2,8 +2,11 @@ package me.blackvein.quests.util; import java.util.LinkedList; import java.util.Map.Entry; + import me.blackvein.quests.Quester; import me.blackvein.quests.Quests; +import net.milkbowl.vault.item.Items; + import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.enchantments.Enchantment; @@ -214,7 +217,7 @@ public class ItemUtil implements ColorUtil { if (is.hasItemMeta() && is.getItemMeta().hasDisplayName()) { text = "" + DARKAQUA + ITALIC + is.getItemMeta().getDisplayName(); } else { - text = AQUA + Quester.prettyItemString(is.getType().name()); + text = AQUA + Items.itemByStack(is).getName(); } return text;