Update menus to use UserFilteredSlot
This commit is contained in:
parent
784930e396
commit
e3a11b3b9e
@ -8,6 +8,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.UserFilteredSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledMatterGaugePanel
|
||||
@ -25,7 +26,7 @@ class MatterDecomposerScreen(p_97741_: MatterDecomposerMenu, p_97742_: Inventory
|
||||
|
||||
BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE)
|
||||
|
||||
SlotPanel(this, frame, menu.input, 122f, PROGRESS_SLOT_TOP)
|
||||
UserFilteredSlotPanel(this, frame, menu.input, 122f, PROGRESS_SLOT_TOP)
|
||||
ProgressGaugePanel(this, frame, menu.progressWidget, 96f, PROGRESS_ARROW_TOP).also { it.flop = true }
|
||||
SlotPanel(this, frame, menu.outputMain, 74f, PROGRESS_SLOT_TOP)
|
||||
SlotPanel(this, frame, menu.outputStacking, 56f, PROGRESS_SLOT_TOP)
|
||||
|
@ -11,6 +11,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.SpritePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.button.DeviceControls
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.AbstractSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.UserFilteredSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.util.GridPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
import ru.dbotthepony.mc.otm.compat.jei.MatterEntanglerRecipeCategory
|
||||
@ -30,7 +31,7 @@ class MatterEntanglerScreen(menu: MatterEntanglerMenu, inventory: Inventory, tit
|
||||
it.dockResize = DockResizeMode.NONE
|
||||
|
||||
for (slot in menu.inputs)
|
||||
SlotPanel(this, it, slot)
|
||||
UserFilteredSlotPanel(this, it, slot)
|
||||
}
|
||||
|
||||
ProgressGaugePanel(this, frame, menu.progress).also {
|
||||
|
@ -10,9 +10,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.PlayerEquipmentPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.makeCuriosPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.BatterySlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.UserFilteredSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledMatterGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProfiledPowerGaugePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||
@ -27,7 +25,7 @@ class MatterReconstructorScreen(menu: MatterReconstructorMenu, inventory: Invent
|
||||
|
||||
BatterySlotPanel(this, frame, menu.batterySlot, LEFT_MARGIN, SLOT_TOP_UNDER_GAUGE)
|
||||
|
||||
SlotPanel(this, frame, menu.slot, 66f, PROGRESS_SLOT_TOP)
|
||||
UserFilteredSlotPanel(this, frame, menu.slot, 66f, PROGRESS_SLOT_TOP)
|
||||
ProgressGaugePanel(this, frame, menu.progress, 37f, PROGRESS_ARROW_TOP)
|
||||
|
||||
makeDeviceControls(this, frame, redstoneConfig = menu.redstoneConfig, itemConfig = menu.itemConfig, energyConfig = menu.energyConfig, upgrades = menu.upgrades)
|
||||
|
@ -9,7 +9,7 @@ import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||
import ru.dbotthepony.mc.otm.matter.MatterManager
|
||||
import ru.dbotthepony.mc.otm.menu.OutputMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.UserFilteredMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.input.ItemConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.makeUpgradeSlots
|
||||
@ -21,7 +21,7 @@ class MatterDecomposerMenu(
|
||||
inventory: Inventory,
|
||||
tile: MatterDecomposerBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) {
|
||||
val input = object : MatteryMenuSlot(tile?.inputContainer ?: SlottedContainer.filtered(1), 0) {
|
||||
val input = object : UserFilteredMenuSlot(tile?.inputContainer ?: SlottedContainer.filtered(1), 0) {
|
||||
override fun mayPlace(itemStack: ItemStack) = MatterManager.canDecompose(itemStack)
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import ru.dbotthepony.mc.otm.item.IQuantumLinked
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
|
||||
import ru.dbotthepony.mc.otm.menu.OutputMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.UserFilteredMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.input.ItemConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.makeSlots
|
||||
@ -36,8 +37,8 @@ class MatterEntanglerMenu(
|
||||
|
||||
val progress = ProgressGaugeWidget(this, tile?.jobEventLoops?.get(0))
|
||||
|
||||
val inputs: List<MatteryMenuSlot> = makeSlots(tile?.inputs ?: SlottedContainer.simple(3 * 3, AutomationFilters.ALLOW.limitedFilteredProvider)) { it, i ->
|
||||
object : MatteryMenuSlot(it, i) {
|
||||
val inputs: List<UserFilteredMenuSlot> = makeSlots(tile?.inputs ?: SlottedContainer.simple(3 * 3, AutomationFilters.ALLOW.limitedFilteredProvider)) { it, i ->
|
||||
object : UserFilteredMenuSlot(it, i) {
|
||||
override fun mayPlace(itemStack: ItemStack): Boolean {
|
||||
val list = it.toList()
|
||||
list[i] = itemStack
|
||||
|
@ -1,12 +1,11 @@
|
||||
package ru.dbotthepony.mc.otm.menu.matter
|
||||
|
||||
import net.minecraft.world.SimpleContainer
|
||||
import net.minecraft.world.entity.player.Inventory
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.block.entity.matter.MatterReconstructorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.UserFilteredMenuSlot
|
||||
import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.input.ItemConfigPlayerInput
|
||||
import ru.dbotthepony.mc.otm.menu.makeUpgradeSlots
|
||||
@ -21,7 +20,7 @@ class MatterReconstructorMenu(
|
||||
tile: MatterReconstructorBlockEntity? = null
|
||||
) : MatteryPoweredMenu(MMenus.ITEM_REPAIER, containerId, inventory, tile) {
|
||||
val matterWidget = ProfiledLevelGaugeWidget(this, tile?.matter, LevelGaugeWidget(this, tile?.matter))
|
||||
val slot = object : MatteryMenuSlot(tile?.repairContainer ?: SlottedContainer.filtered(1), 0) {
|
||||
val slot = object : UserFilteredMenuSlot(tile?.repairContainer ?: SlottedContainer.filtered(1), 0) {
|
||||
override fun mayPlace(itemStack: ItemStack): Boolean {
|
||||
return itemStack.isRepairable && itemStack.isDamaged && super.mayPlace(itemStack)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user