Skip to content

Commit 88c08c6

Browse files
committed
fix AutoArmor durability checks
1 parent 9d047cb commit 88c08c6

File tree

1 file changed

+5
-2
lines changed
  • src/main/kotlin/com/lambda/module/modules/player

1 file changed

+5
-2
lines changed

src/main/kotlin/com/lambda/module/modules/player/AutoArmor.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ object AutoArmor : Module(
6767
val armorSlots = player.armorSlots
6868

6969
val sorter = compareByDescending<Slot> {
70-
if (it.stack.damage.toFloat() / it.stack.maxDamage < 1 - (minDurabilityPercentage.toFloat() / 100)) Double.MIN_VALUE
71-
else if (elytraPriority) {
70+
if (it.stack.isDamageable && 1 - (it.stack.damage.toFloat() / it.stack.maxDamage) < minDurabilityPercentage.toFloat() / 100)
71+
-Double.MAX_VALUE
72+
else 0.0
73+
}.thenByDescending {
74+
if (elytraPriority) {
7275
if (it.stack.item == Items.ELYTRA) 1.0
7376
else 0.0
7477
} else 0.0

0 commit comments

Comments
 (0)