Fixed use of ItemMeta in lookup

This commit is contained in:
Auxilor 2023-04-27 18:50:04 +01:00
parent 722680aae0
commit 77ca1551c3

View File

@ -2,6 +2,7 @@ package com.willfp.ecoenchants.target
import com.github.benmanes.caffeine.cache.Caffeine
import com.willfp.eco.core.fast.fast
import com.willfp.eco.core.items.HashedItem
import com.willfp.ecoenchants.enchants.EcoEnchant
import com.willfp.ecoenchants.enchants.EcoEnchantLevel
import com.willfp.ecoenchants.target.EnchantLookup.getEnchantLevel
@ -27,7 +28,11 @@ data class ItemInSlot internal constructor(
data class ItemInNumericSlot internal constructor(
val item: ItemStack,
val slot: Int
)
) {
override fun hashCode(): Int {
return HashedItem.of(item).hash + (slot shl 31)
}
}
private data class HeldEnchant(
val enchant: EcoEnchant,