From efbc93e16a4a74fc8fb784a944ac3dab393946f5 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 5 Mar 2025 19:01:24 +0700 Subject: [PATCH] Make IAutomatedContainer implement IItemHandlerModifiable --- .../dbotthepony/mc/otm/container/IAutomatedContainer.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) }