diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/ContainerSlot.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/ContainerSlot.kt index 7d4821597..178ee81f5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/ContainerSlot.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/ContainerSlot.kt @@ -133,6 +133,13 @@ open class ContainerSlot( override val maxStackSize: Int get() = this@Simple.maxStackSize + override fun maxStackSize(item: ItemStack): Int { + if (maxStackSize == Int.MAX_VALUE) + return Int.MAX_VALUE + + return super.maxStackSize(item) + } + override fun notifyChanged(old: ItemStack) { super.notifyChanged(old) listener(item, old) @@ -160,6 +167,7 @@ open class ContainerSlot( } } + companion object { private val LOGGER = LogManager.getLogger() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/FilteredContainerSlot.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/FilteredContainerSlot.kt index 4e2d50f3d..11a59da02 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/FilteredContainerSlot.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/slotted/FilteredContainerSlot.kt @@ -68,6 +68,13 @@ open class FilteredContainerSlot( override val maxStackSize: Int get() = this@Simple.maxStackSize + override fun maxStackSize(item: ItemStack): Int { + if (maxStackSize == Int.MAX_VALUE) + return Int.MAX_VALUE + + return super.maxStackSize(item) + } + override fun notifyChanged(old: ItemStack) { super.notifyChanged(old) listener(item, old)