Ignore durability for extreme values, untested. Fixes #620

This commit is contained in:
BuildTools 2019-01-07 17:29:28 -05:00
parent e3f388e485
commit 03a866465c
2 changed files with 7 additions and 1 deletions

View File

@ -357,6 +357,10 @@ public class ItemStackPrompt extends FixedSetPrompt {
return new ItemStackPrompt(oldPrompt);
}
} catch (NumberFormatException e) {
if (input.equals("*")) {
cc.setSessionData("tempData", Short.parseShort("999")); // wildcard value
return new ItemStackPrompt(oldPrompt);
}
cc.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("itemCreateInvalidInput"));
return new DataPrompt();
}

View File

@ -62,7 +62,9 @@ public class ItemUtil {
} else if ((one.getAmount() != two.getAmount()) && ignoreAmount == false) {
return -2;
} else if (one.getDurability() != two.getDurability()) {
return -3;
if (one.getDurability() >= 999 && two.getDurability() >= 999) { // wildcard value
return -3;
}
}
if (one.hasItemMeta() || two.hasItemMeta()) {
if (one.hasItemMeta() && two.hasItemMeta() == false) {