Add matter reconstructor controls

This commit is contained in:
DBotThePony 2023-03-25 00:30:17 +07:00
parent 917a498e1e
commit df130211c3
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 17 additions and 0 deletions

View File

@ -4,6 +4,7 @@ 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.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.SlotPanel
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)
makeDeviceControls(this, frame, redstone = menu.redstoneControl, itemConfig = menu.itemConfig, energyConfig = menu.energyConfig)
return frame
}
}

View File

@ -3,10 +3,14 @@ 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.RedstoneSetting
import ru.dbotthepony.mc.otm.block.entity.matter.ItemRepairerBlockEntity
import ru.dbotthepony.mc.otm.capability.matter.matter
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
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.registry.MMenus
@ -22,8 +26,18 @@ class ItemRepairerMenu(
}
}
val redstoneControl = EnumInputWithFeedback<RedstoneSetting>(this)
val energyConfig = EnergyPlayerInput(this)
val itemConfig = ItemHandlerPlayerInput(this)
init {
addStorageSlot(slot)
addInventorySlots()
if (tile != null) {
redstoneControl.with(tile.redstoneControl::redstoneSetting)
itemConfig.configure(tile.itemConfig)
energyConfig.configure(tile.energyConfig)
}
}
}