Improved WG compatibility + Tree Feller will now damage unbreaking

enchant tools again
This commit is contained in:
nossr50
2019-06-24 17:32:05 -07:00
parent 214974e3a3
commit a135e08e12
7 changed files with 125 additions and 42 deletions

View File

@ -148,9 +148,8 @@ public final class Woodcutting {
* @return True if the tool can sustain the durability loss
*/
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
if((inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1)
|| (inHand.getItemMeta() != null && inHand.getItemMeta().isUnbreakable())) {
//Treat the NBT tag for unbreakable and the durability enchant differently
if(inHand.getItemMeta() != null && inHand.getItemMeta().isUnbreakable()) {
return true;
}