From edb723e4230ad0c67518a2323273871735db728d Mon Sep 17 00:00:00 2001 From: nea Date: Mon, 29 May 2023 23:33:46 +0200 Subject: Fix stacksize being shared by different item stacks --- src/main/kotlin/moe/nea/firmament/rei/SBItemEntryDefinition.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { 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 { override fun hash(entry: EntryStack, 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?, value: SBItemStack): SBItemStack { -- cgit