From d17e64f33516bbd2f73e484728f84f5dfe3ec0d3 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 22 Mar 2025 15:10:17 +0700 Subject: [PATCH] Fix slotted container has empty bitmap after deserialization --- .../ru/dbotthepony/mc/otm/container/slotted/SlottedContainer.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/SlottedContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/SlottedContainer.kt index 2f013f4d6..31a8b5795 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/SlottedContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/SlottedContainer.kt @@ -274,6 +274,7 @@ class SlottedContainer( for ((item, slot) in items) { if (slot in 0 until containerSize) { slots[slot].item = item + bitmap[slot] = item.isNotEmpty } else if (item.isNotEmpty) { ItemStack.CODEC.encodeStart(provider.createSerializationContext(NbtOps.INSTANCE), item) .ifError { LOGGER.warn("Unable to serialize 'lost' item: ${it.message()}") } @@ -307,6 +308,7 @@ class SlottedContainer( if (i in 0 until containerSize) { slots[i].deserializeNBT(provider, element) + bitmap[i] = slots[i].isNotEmpty } else { lostItems.add(element) this.provider = provider