File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/kotlin/com/lambda/module/modules/player Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ object AutoArmor : Module(
100100 val swappable = player.hotbarAndInventorySlots
101101 .filter { it.stack.isEquipable && (! ignoreBinding || it.stack.getEnchantment(Enchantments .BINDING_CURSE ) <= 0 ) }
102102 .sortedWith(sorter)
103- .distinctBy { it.stack.item }
103+ .distinctBy { it.stack.armorSlot }
104104
105105 val swaps = mutableListOf<Pair <Slot , Slot >>()
106106 armorSlots.forEach { equipped ->
@@ -130,6 +130,10 @@ object AutoArmor : Module(
130130 private val ItemStack .isEquipable get() =
131131 safeContext.player.armorSlots.any { it.canInsert(this ) }
132132
133+ context(safeContext: SafeContext )
134+ private val ItemStack .armorSlot get() =
135+ safeContext.player.armorSlots.firstOrNull { it.canInsert(this ) }
136+
133137 private enum class Protection (val enchant : RegistryKey <Enchantment >) {
134138 Protection (Enchantments .PROTECTION ),
135139 BlastProtection (Enchantments .BLAST_PROTECTION ),
You can’t perform that action at this time.
0 commit comments