mirror of
https://github.com/songoda/UltimateTimber.git
synced 2024-11-15 14:55:46 +01:00
Handle tool unbreaking tags in 1.9+
This commit is contained in:
parent
0b57057b4d
commit
2524442911
@ -60,7 +60,7 @@ public class CurrentAdapter implements VersionAdapter {
|
||||
@Override
|
||||
public void applyToolDurability(Player player, int damage) {
|
||||
ItemStack tool = this.getItemInHand(player);
|
||||
if (tool.getType().getMaxDurability() < 1)
|
||||
if (tool.getType().getMaxDurability() < 1 || (tool.getItemMeta() != null && tool.getItemMeta().isUnbreakable()))
|
||||
return;
|
||||
|
||||
int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY);
|
||||
|
@ -106,7 +106,7 @@ public class LegacyAdapter implements VersionAdapter {
|
||||
@Override
|
||||
public void applyToolDurability(Player player, int damage) {
|
||||
ItemStack tool = this.getItemInHand(player);
|
||||
if (tool.getType().getMaxDurability() < 1)
|
||||
if (tool.getType().getMaxDurability() < 1 || (NMSUtil.getVersionNumber() > 8 && tool.getItemMeta() != null && tool.getItemMeta().isUnbreakable()))
|
||||
return;
|
||||
|
||||
int unbreakingLevel = tool.getEnchantmentLevel(Enchantment.DURABILITY);
|
||||
|
@ -212,7 +212,7 @@ trees:
|
||||
- LEAVES:1,5,9,13
|
||||
sapling: SAPLING:1
|
||||
plantable-soil: []
|
||||
max-log-distance-from-trunk: 1
|
||||
max-log-distance-from-trunk: 2
|
||||
max-leaf-distance-from-log: 6
|
||||
search-for-leaves-diagonally: false
|
||||
drop-original-log: true
|
||||
|
Loading…
Reference in New Issue
Block a user