From 6c7f2226a6abc821375b3ccb27af3df84eae518e Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 12 Aug 2023 14:49:24 +0700 Subject: [PATCH] Unify storage exportert/importer menus, profile their energy and add energy config --- .../block/entity/storage/StorageInterfaces.kt | 45 +++++---------- .../client/screen/storage/StorageBusScreen.kt | 2 +- .../screen/storage/StorageExporterScreen.kt | 36 ------------ .../storage/StorageImporterExporterScreen.kt | 55 +++++++++++++++++++ .../screen/storage/StorageImporterScreen.kt | 36 ------------ .../mc/otm/menu/storage/StorageBusMenu.kt | 2 + .../otm/menu/storage/StorageExporterMenu.kt | 22 -------- .../storage/StorageImporterExporterMenu.kt | 24 ++++++++ .../otm/menu/storage/StorageImporterMenu.kt | 18 ------ .../ru/dbotthepony/mc/otm/registry/MMenus.kt | 13 ++--- 10 files changed, 101 insertions(+), 152 deletions(-) delete mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageExporterScreen.kt create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterExporterScreen.kt delete mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterScreen.kt delete mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageExporterMenu.kt create mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterExporterMenu.kt delete mode 100644 src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterMenu.kt diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt index 879dad5d7..da0082640 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt @@ -11,14 +11,15 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState -import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.capabilities.ForgeCapabilities import net.minecraftforge.items.IItemHandler import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.SERVER_IS_LIVE import ru.dbotthepony.mc.otm.block.CableBlock import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity +import ru.dbotthepony.mc.otm.capability.FlowDirection import ru.dbotthepony.mc.otm.capability.MatteryCapability +import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage import ru.dbotthepony.mc.otm.config.EnergyBalanceValues import ru.dbotthepony.mc.otm.config.MachinesConfig @@ -28,8 +29,7 @@ import ru.dbotthepony.mc.otm.core.isNotEmpty import ru.dbotthepony.mc.otm.core.math.RelativeSide import ru.dbotthepony.mc.otm.core.orNull import ru.dbotthepony.mc.otm.graph.storage.StorageNode -import ru.dbotthepony.mc.otm.menu.storage.StorageExporterMenu -import ru.dbotthepony.mc.otm.menu.storage.StorageImporterMenu +import ru.dbotthepony.mc.otm.menu.storage.StorageImporterExporterMenu import ru.dbotthepony.mc.otm.once import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MNames @@ -41,13 +41,15 @@ import java.math.BigInteger import java.util.* import kotlin.collections.ArrayList -abstract class AbstractStorageImportExport( +abstract class AbstractStorageImportExport( blockType: BlockEntityType<*>, blockPos: BlockPos, blockState: BlockState, energyValues: EnergyBalanceValues = MachinesConfig.STORAGE_INTERFACES ) : MatteryPoweredBlockEntity(blockType, blockPos, blockState) { - val energy = WorkerEnergyStorage(::setChangedLight, energyValues) + val energy = ProfiledEnergyStorage(WorkerEnergyStorage(::setChangedLight, energyValues)) + val energyConfig = ConfigurableEnergy(energy, modesFront = FlowDirection.NONE) + val cell: StorageNode = object : StorageNode(energy) { override fun onNeighbour(link: Link) { if (link is DirectionLink) { @@ -76,8 +78,11 @@ abstract class AbstractStorageImportExport( } } + override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { + return StorageImporterExporterMenu(containerID, inventory, this) + } + init { - exposeEnergyGlobally(energy) savetable(::energy, ENERGY_KEY) exposeGlobally(MatteryCapability.STORAGE_NODE, cell) { it != RelativeSide.FRONT } } @@ -92,11 +97,7 @@ abstract class AbstractStorageImportExport( cell.discover(this) } - protected abstract val targetCapability: Capability - - protected val target by lazy { - front.track(targetCapability) - } + protected val target = front.track(ForgeCapabilities.ITEM_HANDLER) abstract val filter: ItemFilter @@ -106,26 +107,20 @@ abstract class AbstractStorageImportExport( companion object { const val FILTER_KEY = "filter" + const val MAX_FILTERS = 6 * 3 } } class StorageImporterBlockEntity( blockPos: BlockPos, blockState: BlockState -) : AbstractStorageImportExport(MBlockEntities.STORAGE_IMPORTER, blockPos, blockState), IItemHandler { +) : AbstractStorageImportExport(MBlockEntities.STORAGE_IMPORTER, blockPos, blockState), IItemHandler { override val filter = ItemFilter(MAX_FILTERS) { setChangedLight() } - override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return StorageImporterMenu(containerID, inventory, this) - } - private var lastSlot = 0 private var nextTick = INTERVAL - override val targetCapability: Capability - get() = ForgeCapabilities.ITEM_HANDLER - init { front.Cap(ForgeCapabilities.ITEM_HANDLER, this) } @@ -212,7 +207,6 @@ class StorageImporterBlockEntity( if (leftover.count != extracted.count) { val extracted2 = target.extractItem(lastSlot, extracted.count - leftover.count, false) acceptItem(extracted2, false) - nextTick += INTERVAL * 4 } } } @@ -225,20 +219,15 @@ class StorageImporterBlockEntity( companion object { const val MAX_MOVE_PER_OPERATION = 4 private const val INTERVAL = 5 - const val MAX_FILTERS = 6 * 3 } } class StorageExporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : - AbstractStorageImportExport(MBlockEntities.STORAGE_EXPORTER, blockPos, blockState), + AbstractStorageImportExport(MBlockEntities.STORAGE_EXPORTER, blockPos, blockState), IStorageEventConsumer { override val defaultDisplayName: Component get() = MACHINE_NAME - override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { - return StorageExporterMenu(containerID, inventory, this) - } - private val relevantTuples = ObjectOpenHashSet() override val storageType: StorageStack.Type @@ -281,9 +270,6 @@ class StorageExporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : private var lastSlot = 0 private var nextTick = INTERVAL - override val targetCapability: Capability - get() = ForgeCapabilities.ITEM_HANDLER - override fun tick() { super.tick() @@ -346,6 +332,5 @@ class StorageExporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : val MAX_MOVE_PER_OPERATION: BigInteger = BigInteger.valueOf(4L) private val MACHINE_NAME = TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.STORAGE_EXPORTER}") private const val INTERVAL = 5 - const val MAX_FILTERS = 6 * 3 } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageBusScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageBusScreen.kt index 2e52a31b3..9097f7aba 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageBusScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageBusScreen.kt @@ -51,7 +51,7 @@ class StorageBusScreen(menu: StorageBusMenu, inventory: Inventory, title: Compon it.childrenOrder = -3 } - val controls = DeviceControls(this, frame, redstoneConfig = menu.redstoneConfig) + val controls = DeviceControls(this, frame, redstoneConfig = menu.redstoneConfig, energyConfig = menu.energyConfig) val mode = LargeEnumRectangleButtonPanel(this, frame, prop = menu.mode, defaultValue = FlowDirection.BI_DIRECTIONAL, enum = FlowDirection::class.java) mode.add(FlowDirection.INPUT, Widgets18.ONLY_STORE, FlowDirection.INPUT.title) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageExporterScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageExporterScreen.kt deleted file mode 100644 index 6b4b7dbdc..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageExporterScreen.kt +++ /dev/null @@ -1,36 +0,0 @@ -package ru.dbotthepony.mc.otm.client.screen.storage - -import net.minecraft.network.chat.Component -import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.client.screen.MatteryScreen -import ru.dbotthepony.mc.otm.core.TranslatableComponent -import ru.dbotthepony.mc.otm.client.screen.panels.* -import ru.dbotthepony.mc.otm.client.screen.panels.button.CheckBoxLabelInputPanel -import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls -import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel -import ru.dbotthepony.mc.otm.client.screen.panels.slot.FilterSlotPanel -import ru.dbotthepony.mc.otm.client.screen.widget.WidePowerGaugePanel - -import ru.dbotthepony.mc.otm.menu.storage.StorageExporterMenu - -class StorageExporterScreen(menu: StorageExporterMenu, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { - override fun makeMainFrame(): FramePanel> { - val frame = super.makeMainFrame()!! - - WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT) - BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE) - - for (row in 0 .. 2) { - for (column in 0 .. 5) { - FilterSlotPanel(this, frame, menu.busFilterSlots[row + column * 3], 55f + 18f * column, 17f + 18f * row) - } - } - - CheckBoxLabelInputPanel(this, frame, menu.busFilterState, TranslatableComponent("otm.gui.filter.is_whitelist"), 59f, 78f, width = 170f) - - makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig) - - return frame - } -} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterExporterScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterExporterScreen.kt new file mode 100644 index 000000000..75f24ef60 --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterExporterScreen.kt @@ -0,0 +1,55 @@ +package ru.dbotthepony.mc.otm.client.screen.storage + +import net.minecraft.network.chat.Component +import net.minecraft.world.entity.player.Inventory +import ru.dbotthepony.mc.otm.client.screen.MatteryScreen +import ru.dbotthepony.mc.otm.core.TranslatableComponent +import ru.dbotthepony.mc.otm.client.screen.panels.* +import ru.dbotthepony.mc.otm.client.screen.panels.button.CheckBoxLabelInputPanel +import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls +import ru.dbotthepony.mc.otm.client.screen.panels.slot.AbstractSlotPanel +import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel +import ru.dbotthepony.mc.otm.client.screen.panels.slot.FilterSlotPanel +import ru.dbotthepony.mc.otm.client.screen.panels.util.GridPanel +import ru.dbotthepony.mc.otm.client.screen.widget.WidePowerGaugePanel + +import ru.dbotthepony.mc.otm.menu.storage.StorageImporterExporterMenu + +class StorageImporterExporterScreen(menu: StorageImporterExporterMenu, inventory: Inventory, title: Component) : MatteryScreen(menu, inventory, title) { + override fun makeMainFrame(): FramePanel> { + val frame = FramePanel(this, 148f, 130f, title) + + makeBars(frame, profiledEnergy = menu.profiledEnergy, batterySlot = menu.batterySlot) + + val right = EditablePanel(this, frame, width = AbstractSlotPanel.SIZE * 6f) + right.dock = Dock.RIGHT + val grid = GridPanel(this, right, columns = 6, rows = 3, height = AbstractSlotPanel.SIZE * 3f) + grid.dock = Dock.TOP + + for (slot in menu.filterSlots) { + FilterSlotPanel(this, grid, slot) + } + + CheckBoxLabelInputPanel(this, right, menu.isWhitelist, TranslatableComponent("otm.gui.filter.is_whitelist")).also { + it.dock = Dock.BOTTOM + it.dockTop = 2f + it.childrenOrder = -1 + } + + CheckBoxLabelInputPanel(this, right, menu.matchNBT, TranslatableComponent("otm.gui.filter.match_nbt")).also { + it.dock = Dock.BOTTOM + it.dockTop = 2f + it.childrenOrder = -2 + } + + CheckBoxLabelInputPanel(this, right, menu.matchTag, TranslatableComponent("otm.gui.filter.match_tag")).also { + it.dock = Dock.BOTTOM + it.dockTop = 2f + it.childrenOrder = -3 + } + + makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig, energyConfig = menu.energyConfig) + + return frame + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterScreen.kt deleted file mode 100644 index ecbb2f538..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/storage/StorageImporterScreen.kt +++ /dev/null @@ -1,36 +0,0 @@ -package ru.dbotthepony.mc.otm.client.screen.storage - -import net.minecraft.network.chat.Component -import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.client.screen.MatteryScreen -import ru.dbotthepony.mc.otm.core.TranslatableComponent -import ru.dbotthepony.mc.otm.client.screen.panels.* -import ru.dbotthepony.mc.otm.client.screen.panels.button.CheckBoxLabelInputPanel -import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls -import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel -import ru.dbotthepony.mc.otm.client.screen.panels.slot.FilterSlotPanel -import ru.dbotthepony.mc.otm.client.screen.widget.WidePowerGaugePanel - -import ru.dbotthepony.mc.otm.menu.storage.StorageImporterMenu - -class StorageImporterScreen(menu: StorageImporterMenu, inventory: Inventory, title: Component) : - MatteryScreen(menu, inventory, title) { - override fun makeMainFrame(): FramePanel> { - val frame = super.makeMainFrame()!! - - WidePowerGaugePanel(this, frame, menu.energyWidget, LEFT_MARGIN, GAUGE_TOP_WITH_SLOT) - BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE) - - for (row in 0 .. 2) { - for (column in 0 .. 5) { - FilterSlotPanel(this, frame, menu.busFilterSlots[row + column * 3], 55f + 18f * column, 17f + 18f * row) - } - } - - CheckBoxLabelInputPanel(this, frame, menu.busFilterState, TranslatableComponent("otm.gui.filter.is_whitelist"), 59f, 78f, width = 170f) - - makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig) - - return frame - } -} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageBusMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageBusMenu.kt index c4fe3c48d..fa06e69be 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageBusMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageBusMenu.kt @@ -5,6 +5,7 @@ import ru.dbotthepony.mc.otm.block.entity.storage.StorageBusBlockEntity import ru.dbotthepony.mc.otm.capability.FlowDirection import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback +import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput import ru.dbotthepony.mc.otm.menu.input.EnumInputWithFeedback import ru.dbotthepony.mc.otm.menu.input.IntInputWithFeedback import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget @@ -20,6 +21,7 @@ class StorageBusMenu( val insertPriority = IntInputWithFeedback(this, tile?.let { it::insertPriority }) val extractPriority = IntInputWithFeedback(this, tile?.let { it::extractPriority }) val profiledEnergy = ProfiledLevelGaugeWidget(this, tile?.energy, energyWidget) + val energyConfig = EnergyConfigPlayerInput(this, tile?.energyConfig) val mode = EnumInputWithFeedback(this, tile?.let { it::mode }, FlowDirection.WITHOUT_NONE) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageExporterMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageExporterMenu.kt deleted file mode 100644 index b669facf2..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageExporterMenu.kt +++ /dev/null @@ -1,22 +0,0 @@ -package ru.dbotthepony.mc.otm.menu.storage - -import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.storage.StorageExporterBlockEntity -import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu -import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback -import ru.dbotthepony.mc.otm.registry.MMenus - -class StorageExporterMenu( - p_38852_: Int, - inventory: Inventory, - tile: StorageExporterBlockEntity? = null -) : MatteryPoweredMenu( - MMenus.STORAGE_EXPORTER, p_38852_, inventory, tile -) { - val busFilterSlots = addFilterSlots(tile?.filter, StorageExporterBlockEntity.MAX_FILTERS) - val busFilterState = BooleanInputWithFeedback(this, tile?.let { it.filter::isWhitelist }) - - init { - addInventorySlots() - } -} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterExporterMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterExporterMenu.kt new file mode 100644 index 000000000..f0573601a --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterExporterMenu.kt @@ -0,0 +1,24 @@ +package ru.dbotthepony.mc.otm.menu.storage + +import net.minecraft.world.entity.player.Inventory +import ru.dbotthepony.mc.otm.block.entity.storage.AbstractStorageImportExport +import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu +import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback +import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput +import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget +import ru.dbotthepony.mc.otm.registry.MMenus + +class StorageImporterExporterMenu( + containerId: Int, inventory: Inventory, tile: AbstractStorageImportExport? = null +) : MatteryPoweredMenu(MMenus.STORAGE_IMPORTER_EXPORTER, containerId, inventory, tile) { + val filterSlots = addFilterSlots(tile?.filter, AbstractStorageImportExport.MAX_FILTERS) + val isWhitelist = BooleanInputWithFeedback(this, tile?.let { it.filter::isWhitelist }) + val matchNBT = BooleanInputWithFeedback(this, tile?.let { it.filter::matchNBT }) + val matchTag = BooleanInputWithFeedback(this, tile?.let { it.filter::matchTag }) + val profiledEnergy = ProfiledLevelGaugeWidget(this, tile?.energy, energyWidget) + val energyConfig = EnergyConfigPlayerInput(this, tile?.energyConfig) + + init { + addInventorySlots() + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterMenu.kt deleted file mode 100644 index 401bf92e6..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/storage/StorageImporterMenu.kt +++ /dev/null @@ -1,18 +0,0 @@ -package ru.dbotthepony.mc.otm.menu.storage - -import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.storage.StorageImporterBlockEntity -import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu -import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback -import ru.dbotthepony.mc.otm.registry.MMenus - -class StorageImporterMenu( - containerId: Int, inventory: Inventory, tile: StorageImporterBlockEntity? = null -) : MatteryPoweredMenu(MMenus.STORAGE_IMPORTER, containerId, inventory, tile) { - val busFilterSlots = addFilterSlots(tile?.filter, StorageImporterBlockEntity.MAX_FILTERS) - val busFilterState = BooleanInputWithFeedback(this, tile?.let { it.filter::isWhitelist }) - - init { - addInventorySlots() - } -} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt index 185878fd5..e6dc21401 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt @@ -26,8 +26,7 @@ import ru.dbotthepony.mc.otm.client.screen.storage.DriveRackScreen import ru.dbotthepony.mc.otm.client.screen.storage.DriveViewerScreen import ru.dbotthepony.mc.otm.client.screen.storage.ItemMonitorScreen import ru.dbotthepony.mc.otm.client.screen.storage.StorageBusScreen -import ru.dbotthepony.mc.otm.client.screen.storage.StorageExporterScreen -import ru.dbotthepony.mc.otm.client.screen.storage.StorageImporterScreen +import ru.dbotthepony.mc.otm.client.screen.storage.StorageImporterExporterScreen import ru.dbotthepony.mc.otm.client.screen.storage.StoragePowerSupplierScreen import ru.dbotthepony.mc.otm.client.screen.tech.AndroidChargerScreen import ru.dbotthepony.mc.otm.client.screen.tech.AndroidStationScreen @@ -57,8 +56,7 @@ import ru.dbotthepony.mc.otm.menu.storage.DriveRackMenu import ru.dbotthepony.mc.otm.menu.storage.DriveViewerMenu import ru.dbotthepony.mc.otm.menu.storage.ItemMonitorMenu import ru.dbotthepony.mc.otm.menu.storage.StorageBusMenu -import ru.dbotthepony.mc.otm.menu.storage.StorageExporterMenu -import ru.dbotthepony.mc.otm.menu.storage.StorageImporterMenu +import ru.dbotthepony.mc.otm.menu.storage.StorageImporterExporterMenu import ru.dbotthepony.mc.otm.menu.storage.StoragePowerSupplierMenu import ru.dbotthepony.mc.otm.menu.tech.AndroidChargerMenu import ru.dbotthepony.mc.otm.menu.tech.AndroidStationMenu @@ -104,8 +102,7 @@ object MMenus { val FLUID_TANK: MenuType by registry.register(MNames.FLUID_TANK) { MenuType(::FluidTankMenu, FeatureFlags.VANILLA_SET) } val STORAGE_BUS: MenuType by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu, FeatureFlags.VANILLA_SET) } - val STORAGE_EXPORTER: MenuType by registry.register(MNames.STORAGE_EXPORTER) { MenuType(::StorageExporterMenu, FeatureFlags.VANILLA_SET) } - val STORAGE_IMPORTER: MenuType by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterMenu, FeatureFlags.VANILLA_SET) } + val STORAGE_IMPORTER_EXPORTER: MenuType by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterExporterMenu, FeatureFlags.VANILLA_SET) } val STORAGE_POWER_SUPPLIER: MenuType by registry.register(MNames.STORAGE_POWER_SUPPLIER) { MenuType(::StoragePowerSupplierMenu, FeatureFlags.VANILLA_SET) } internal fun register(bus: IEventBus) { @@ -113,7 +110,6 @@ object MMenus { bus.addListener(this::registerClient) } - @Suppress("unchecked_cast") private fun registerClient(event: FMLClientSetupEvent) { event.enqueueWork { MenuScreens.register(ANDROID_STATION, ::AndroidStationScreen) @@ -137,8 +133,7 @@ object MMenus { MenuScreens.register(TWIN_PLATE_PRESS, ::TwinPlatePressScreen) MenuScreens.register(MATTER_RECYCLER, ::MatterRecyclerScreen) MenuScreens.register(STORAGE_BUS, ::StorageBusScreen) - MenuScreens.register(STORAGE_EXPORTER, ::StorageExporterScreen) - MenuScreens.register(STORAGE_IMPORTER, ::StorageImporterScreen) + MenuScreens.register(STORAGE_IMPORTER_EXPORTER, ::StorageImporterExporterScreen) MenuScreens.register(STORAGE_POWER_SUPPLIER, ::StoragePowerSupplierScreen) MenuScreens.register(ENERGY_SERVO, ::EnergyServoScreen) MenuScreens.register(HOLO_SIGN, ::HoloSignScreen)