mirror of
https://github.com/songoda/UltimateTimber.git
synced 2024-11-29 05:16:29 +01:00
Don't protect tools which has unbreakable flag
Technically unbreakable tools are unconditionally unbreakable. Long trees are can't be chopping down with unbreakable but low durability tools.
This commit is contained in:
parent
7f1c9ab3a3
commit
7a77e95fe3
@ -117,7 +117,7 @@ public class TreeFallManager extends Manager implements Listener {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
short toolDamage = this.getToolDamage(detectedTree.getDetectedTreeBlocks(), tool.containsEnchantment(Enchantment.SILK_TOUCH));
|
short toolDamage = this.getToolDamage(detectedTree.getDetectedTreeBlocks(), tool.containsEnchantment(Enchantment.SILK_TOUCH));
|
||||||
if (!ConfigurationManager.Setting.PROTECT_TOOL.getBoolean() && !ItemUtils.hasEnoughDurability(tool, toolDamage))
|
if (!tool.getItemMeta().isUnbreakable() && !ConfigurationManager.Setting.PROTECT_TOOL.getBoolean() && !ItemUtils.hasEnoughDurability(tool, toolDamage))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Trigger fall event
|
// Trigger fall event
|
||||||
|
Loading…
Reference in New Issue
Block a user