From 8967d3aafa40b6fa7e37bfc8d7550b05164dfa66 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 6 Mar 2025 20:41:58 +0700 Subject: [PATCH] Make CombinedItemHandler aware that SlottedContainer does not need to be rechecked --- .../dbotthepony/mc/otm/capability/item/CombinedItemHandler.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/item/CombinedItemHandler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/item/CombinedItemHandler.kt index 83c426d0f..cd21d7221 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/item/CombinedItemHandler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/item/CombinedItemHandler.kt @@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableList import net.minecraft.world.item.ItemStack import net.neoforged.neoforge.items.IItemHandler import ru.dbotthepony.mc.otm.container.ContainerHandler +import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer import java.util.stream.Stream class CombinedItemHandler(val handlers: ImmutableList) : IItemHandler { @@ -11,7 +12,7 @@ class CombinedItemHandler(val handlers: ImmutableList) : IItemHand constructor(handlers: Collection) : this(ImmutableList.copyOf(handlers)) constructor(vararg handlers: IItemHandler) : this(ImmutableList.copyOf(handlers)) - private val needsChecking = handlers.any { it !is ContainerHandler } + private val needsChecking = handlers.any { it !is ContainerHandler && it !is SlottedContainer } private val lastSizes = IntArray(this.handlers.size) private var totalSize = 0 private val mappings = ArrayList()