Remove addBatterySlot of PoweredMatteryMenu
This commit is contained in:
parent
9f093a74ed
commit
97cb64b3c5
@ -49,7 +49,6 @@ public class MatterDecomposerMenu extends PoweredMatteryMenu {
|
||||
progress = new ProgressGaugeWidget(this, () -> (float) tile.getWorkProgress(), tile::cantProcessJob);
|
||||
}
|
||||
|
||||
addBatterySlot(14);
|
||||
addInventorySlots();
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ public class MatterReplicatorMenu extends PoweredMatteryMenu {
|
||||
progress = new ProgressGaugeWidget(this);
|
||||
}
|
||||
|
||||
addBatterySlot(14);
|
||||
addInventorySlots();
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ class AndroidStationMenu @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
addSlot(androidBattery)
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,6 @@ class DriveRackMenu @JvmOverloads constructor(
|
||||
addSlot(slot)
|
||||
}
|
||||
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,6 @@ class DriveViewerMenu @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
addSlot(driveSlot)
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ class ItemMonitorMenu @JvmOverloads constructor(
|
||||
local = null
|
||||
}
|
||||
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@ class MatterBottlerMenu @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
addDataSlots(workFlow)
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,6 @@ class MatterScannerMenu @JvmOverloads constructor(
|
||||
patterns = LevelGaugeWidget(this)
|
||||
}
|
||||
|
||||
addBatterySlot()
|
||||
addInventorySlots()
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,7 @@ abstract class MatteryMenu protected @JvmOverloads constructor(
|
||||
@JvmField
|
||||
protected var inventorySlotIndexEnd = 0
|
||||
|
||||
@JvmOverloads
|
||||
protected fun addInventorySlots(offset: Int = 97) {
|
||||
protected fun addInventorySlots() {
|
||||
var first = true
|
||||
|
||||
for (i in 0..2) {
|
||||
|
@ -13,25 +13,16 @@ abstract class PoweredMatteryMenu protected constructor(
|
||||
inventory: Inventory,
|
||||
tile: BlockEntityMatteryPowered? = null
|
||||
) : MatteryMenu(menuType, containerID, inventory, tile) {
|
||||
@JvmField
|
||||
val powerWidget: LevelGaugeWidget
|
||||
|
||||
@JvmField
|
||||
var batterySlot: BatterySlot? = null
|
||||
@JvmField val powerWidget: LevelGaugeWidget
|
||||
@JvmField val batterySlot: BatterySlot
|
||||
|
||||
init {
|
||||
if (tile == null || tile.getCapability(MatteryCapability.ENERGY).resolve().isEmpty) {
|
||||
powerWidget = LevelGaugeWidget(this)
|
||||
batterySlot = BatterySlot(SimpleContainer(1), 0)
|
||||
} else {
|
||||
powerWidget = LevelGaugeWidget(this, tile.getCapability(MatteryCapability.ENERGY).resolve().get())
|
||||
batterySlot = BatterySlot(tile.battery_container, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
protected fun addBatterySlot(x: Int = 10, y: Int = 66) {
|
||||
val container = if (tile is BlockEntityMatteryPowered) tile.battery_container else SimpleContainer(1)
|
||||
val batterySlot = BatterySlot(container, 0, x, y)
|
||||
addSlot(batterySlot)
|
||||
this.batterySlot = batterySlot
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user