aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea')
-rw-r--r--src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt b/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt
index a6d683d..3f6ac75 100644
--- a/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt
+++ b/src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt
@@ -47,6 +47,10 @@ data class SBItemStack(
object SBItemEntryDefinition : EntryDefinition<SBItemStack> {
override fun equals(o1: SBItemStack, o2: SBItemStack, context: ComparisonContext): Boolean {
+ if (!context.isFuzzy) {
+ if (o1.stackSize != o2.stackSize)
+ return false
+ }
return o1.skyblockId == o2.skyblockId
}
@@ -73,7 +77,7 @@ object SBItemEntryDefinition : EntryDefinition<SBItemStack> {
override fun hash(entry: EntryStack<SBItemStack>, value: SBItemStack, context: ComparisonContext): Long {
// Repo items are immutable, and get replaced entirely when loaded from disk
- return value.skyblockId.hashCode() * 31L
+ return value.skyblockId.hashCode() * 31L + if (!context.isExact) value.stackSize else 0
}
override fun wildcard(entry: EntryStack<SBItemStack>?, value: SBItemStack): SBItemStack {