Skip to content

Commit

Permalink
Fixed item parsing in pre 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
ipodtouch0218 committed Aug 4, 2020
1 parent 067d810 commit 81b8872
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/me/ipodtouch0218/iptcore/utils/ItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,15 @@ public ItemBuilder addLore(List<String> additionalLore) {
}

public ItemBuilder setUnbreakable(boolean value) {
meta.setUnbreakable(value);
try {
meta.setUnbreakable(value);
} catch (Throwable e) {
if (value) {
meta.addEnchant(Enchantment.DURABILITY, 10, true);
} else {
meta.removeEnchant(Enchantment.DURABILITY);
}
}
return this;
}

Expand Down

0 comments on commit 81b8872

Please sign in to comment.