diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/container/IAutomatedContainer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/container/IAutomatedContainer.kt index 644b30b3e..2a703741f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/container/IAutomatedContainer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/container/IAutomatedContainer.kt @@ -1,14 +1,16 @@ package ru.dbotthepony.mc.otm.container import net.minecraft.world.Container +import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack import net.neoforged.neoforge.items.IItemHandler +import net.neoforged.neoforge.items.IItemHandlerModifiable /** * Reinforced [ISlottedContainer] which slots are [IAutomatedContainerSlot]s, which * subsequently allow this container to implement [IItemHandler] */ -interface IAutomatedContainer : ISlottedContainer, IItemHandler { +interface IAutomatedContainer : ISlottedContainer, IItemHandlerModifiable { override fun containerSlot(slot: Int): IAutomatedContainerSlot override fun canPlaceItem(slot: Int, itemStack: ItemStack): Boolean { @@ -34,6 +36,10 @@ interface IAutomatedContainer : ISlottedContainer, IItemHandler { return containerSlot(slot).maxStackSize } + override fun setStackInSlot(slot: Int, stack: ItemStack) { + setItem(slot, stack) + } + override fun isItemValid(slot: Int, stack: ItemStack): Boolean { return canPlaceItem(slot, stack) }