mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-03 06:57:58 +01:00
Add more durability checks, fixes #401. Bump version number
This commit is contained in:
parent
e706dbd490
commit
b1b1b16788
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<version>2.7.2</version>
|
||||
<name>quests</name>
|
||||
<url>https://github.com/FlyingPikachu/Quests/</url>
|
||||
<packaging>jar</packaging>
|
||||
|
@ -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()) {
|
||||
|
||||
@ -454,14 +454,13 @@ public class Quester {
|
||||
|
||||
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("_");
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user