Add matter reconstructor controls
This commit is contained in:
parent
917a498e1e
commit
df130211c3
@ -4,6 +4,7 @@ import net.minecraft.network.chat.Component
|
|||||||
import net.minecraft.world.entity.player.Inventory
|
import net.minecraft.world.entity.player.Inventory
|
||||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||||
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
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.BatterySlotPanel
|
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.panels.slot.SlotPanel
|
||||||
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
import ru.dbotthepony.mc.otm.client.screen.widget.MatterGaugePanel
|
||||||
@ -21,6 +22,8 @@ class ItemRepairerScreen(menu: ItemRepairerMenu, inventory: Inventory, title: Co
|
|||||||
|
|
||||||
SlotPanel(this, frame, menu.slot, 80f, PROGRESS_SLOT_TOP)
|
SlotPanel(this, frame, menu.slot, 80f, PROGRESS_SLOT_TOP)
|
||||||
|
|
||||||
|
makeDeviceControls(this, frame, redstone = menu.redstoneControl, itemConfig = menu.itemConfig, energyConfig = menu.energyConfig)
|
||||||
|
|
||||||
return frame
|
return frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,14 @@ package ru.dbotthepony.mc.otm.menu.matter
|
|||||||
import net.minecraft.world.SimpleContainer
|
import net.minecraft.world.SimpleContainer
|
||||||
import net.minecraft.world.entity.player.Inventory
|
import net.minecraft.world.entity.player.Inventory
|
||||||
import net.minecraft.world.item.ItemStack
|
import net.minecraft.world.item.ItemStack
|
||||||
|
import ru.dbotthepony.mc.otm.block.entity.RedstoneSetting
|
||||||
import ru.dbotthepony.mc.otm.block.entity.matter.ItemRepairerBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.matter.ItemRepairerBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.matter
|
import ru.dbotthepony.mc.otm.capability.matter.matter
|
||||||
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
|
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
|
||||||
import ru.dbotthepony.mc.otm.menu.MatterySlot
|
import ru.dbotthepony.mc.otm.menu.MatterySlot
|
||||||
|
import ru.dbotthepony.mc.otm.menu.input.EnergyPlayerInput
|
||||||
|
import ru.dbotthepony.mc.otm.menu.input.EnumInputWithFeedback
|
||||||
|
import ru.dbotthepony.mc.otm.menu.input.ItemHandlerPlayerInput
|
||||||
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||||
import ru.dbotthepony.mc.otm.registry.MMenus
|
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||||
|
|
||||||
@ -22,8 +26,18 @@ class ItemRepairerMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val redstoneControl = EnumInputWithFeedback<RedstoneSetting>(this)
|
||||||
|
val energyConfig = EnergyPlayerInput(this)
|
||||||
|
val itemConfig = ItemHandlerPlayerInput(this)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
addStorageSlot(slot)
|
addStorageSlot(slot)
|
||||||
addInventorySlots()
|
addInventorySlots()
|
||||||
|
|
||||||
|
if (tile != null) {
|
||||||
|
redstoneControl.with(tile.redstoneControl::redstoneSetting)
|
||||||
|
itemConfig.configure(tile.itemConfig)
|
||||||
|
energyConfig.configure(tile.energyConfig)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user