@@ -26,14 +26,14 @@ import com.lambda.event.listener.SafeListener.Companion.listen
2626import com.lambda.interaction.material.ContainerSelection
2727import com.lambda.interaction.material.StackSelection
2828import com.lambda.interaction.material.StackSelection.Companion.select
29- import com.lambda.interaction.material.container.containers.ChestContainer
29+ import com.lambda.interaction.material.container.containers.LootableContainer
3030import com.lambda.interaction.material.container.containers.EnderChestContainer
3131import com.lambda.util.BlockUtils.blockEntity
3232import com.lambda.util.extension.containerStacks
3333import com.lambda.util.reflections.getInstances
3434import net.minecraft.block.entity.BlockEntity
35- import net.minecraft.block.entity.ChestBlockEntity
3635import net.minecraft.block.entity.EnderChestBlockEntity
36+ import net.minecraft.block.entity.LootableContainerBlockEntity
3737import net.minecraft.screen.GenericContainerScreenHandler
3838import net.minecraft.screen.ScreenHandlerType
3939import net.minecraft.screen.slot.Slot
@@ -67,16 +67,14 @@ object ContainerManager : Loadable {
6767 EnderChestContainer .update(handler.containerStacks)
6868 }
6969
70- is ChestBlockEntity -> {
71- // ToDo: Handle double chests and single chests
72- if (handler.type != ScreenHandlerType .GENERIC_9X6 ) return @listen
70+ is LootableContainerBlockEntity -> {
7371 val stacks = handler.containerStacks
7472
7573 containers
76- .filterIsInstance<ChestContainer >()
74+ .filterIsInstance<LootableContainer >()
7775 .find {
7876 it.blockPos == block.pos
79- }?.update(stacks) ? : runtimeContainers.add(ChestContainer (stacks, block.pos))
77+ }?.update(stacks) ? : runtimeContainers.add(LootableContainer (stacks, block.pos))
8078 }
8179 }
8280 lastInteractedBlockEntity = null
0 commit comments