package ru.dbotthepony.mc.otm.menu.storage

import net.minecraft.world.SimpleContainer
import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.block.entity.storage.DriveRackBlockEntity
import ru.dbotthepony.mc.otm.menu.DriveSlot
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
import ru.dbotthepony.mc.otm.menu.MatterySlot
import ru.dbotthepony.mc.otm.registry.MMenus

class DriveRackMenu @JvmOverloads constructor(
	p_38852_: Int,
	inventory: Inventory,
	tile: DriveRackBlockEntity? = null
) : MatteryPoweredMenu(MMenus.DRIVE_RACK, p_38852_, inventory, tile) {
	val storageSlots: List<MatterySlot>

	init {
		val container = tile?.container ?: SimpleContainer(4)

		storageSlots = immutableList(4) {
			addStorageSlot(DriveSlot(container, it))
		}

		addInventorySlots()
	}
}
