Merge pull request #7 from Xayanix/master

Fix unbreakable items
This commit is contained in:
TomTom 2024-04-07 12:05:22 +02:00 committed by GitHub
commit 32fd27f8d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -640,6 +640,8 @@ class Minion(
val meta = toolMeta as? Damageable ?: return
if (toolMeta?.isUnbreakable == true) return
if (Math.random() > 1f / (meta.getEnchantLevel(Enchantment.DURABILITY) + 1)) return
if ((tool?.type?.maxDurability ?: return) <= meta.damage + amount) {