parent
c83c21ef97
commit
0432fa0ed9
@ -302,6 +302,8 @@ private fun blocks(provider: MatteryLanguageProvider) {
|
|||||||
add(MBlocks.PLATE_PRESS, "Plate Press")
|
add(MBlocks.PLATE_PRESS, "Plate Press")
|
||||||
|
|
||||||
add(MBlocks.MATTER_RECYCLER, "Matter Recycler")
|
add(MBlocks.MATTER_RECYCLER, "Matter Recycler")
|
||||||
|
add(MBlocks.ENERGY_SERVO, "Energy Servo")
|
||||||
|
add(MBlocks.ENERGY_SERVO, "desc", "Charges, Discharges or Exchanges energy of items")
|
||||||
|
|
||||||
add(MBlocks.CARBON_FIBRE_BLOCK, "Carbon fibre Block")
|
add(MBlocks.CARBON_FIBRE_BLOCK, "Carbon fibre Block")
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ fun addLootTables(lootTables: LootTables) {
|
|||||||
|
|
||||||
lootTables.dropsSelf(MBlocks.PHANTOM_ATTRACTOR)
|
lootTables.dropsSelf(MBlocks.PHANTOM_ATTRACTOR)
|
||||||
|
|
||||||
|
lootTables.tile(MBlocks.ENERGY_SERVO)
|
||||||
|
|
||||||
lootTables.tile(MBlocks.ENERGY_COUNTER,
|
lootTables.tile(MBlocks.ENERGY_COUNTER,
|
||||||
EnergyCounterBlockEntity.IO_LIMIT_KEY, EnergyCounterBlockEntity.PASSED_ENERGY_KEY,
|
EnergyCounterBlockEntity.IO_LIMIT_KEY, EnergyCounterBlockEntity.PASSED_ENERGY_KEY,
|
||||||
EnergyCounterBlockEntity.POWER_HISTORY_KEY, EnergyCounterBlockEntity.POWER_HISTORY_POINTER_KEY)
|
EnergyCounterBlockEntity.POWER_HISTORY_KEY, EnergyCounterBlockEntity.POWER_HISTORY_POINTER_KEY)
|
||||||
|
@ -147,6 +147,12 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
|
|||||||
.unlockedBy(Tags.Items.ENDER_PEARLS)
|
.unlockedBy(Tags.Items.ENDER_PEARLS)
|
||||||
.build(consumer)
|
.build(consumer)
|
||||||
|
|
||||||
|
MatteryRecipe(MItems.ENERGY_SERVO)
|
||||||
|
.row(MItemTags.PLATE_TRITANIUM, MItems.MACHINE_FRAME, MItemTags.PLATE_TRITANIUM)
|
||||||
|
.row(MItemTags.PLATE_TRITANIUM, MItems.ENERGY_BUS, MItemTags.PLATE_TRITANIUM)
|
||||||
|
.unlockedBy(Tags.Items.ENDER_PEARLS)
|
||||||
|
.build(consumer)
|
||||||
|
|
||||||
// броня
|
// броня
|
||||||
MatteryRecipe(MItems.TRITANIUM_HELMET)
|
MatteryRecipe(MItems.TRITANIUM_HELMET)
|
||||||
.row(MItemTags.PLATE_TRITANIUM, MItemTags.PLATE_TRITANIUM, MItemTags.PLATE_TRITANIUM)
|
.row(MItemTags.PLATE_TRITANIUM, MItemTags.PLATE_TRITANIUM, MItemTags.PLATE_TRITANIUM)
|
||||||
|
@ -54,6 +54,7 @@ fun addTags(tagsProvider: TagsProvider) {
|
|||||||
MBlocks.STORAGE_POWER_SUPPLIER,
|
MBlocks.STORAGE_POWER_SUPPLIER,
|
||||||
|
|
||||||
MBlocks.PHANTOM_ATTRACTOR,
|
MBlocks.PHANTOM_ATTRACTOR,
|
||||||
|
MBlocks.ENERGY_SERVO,
|
||||||
), Tiers.IRON)
|
), Tiers.IRON)
|
||||||
|
|
||||||
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
|
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.block
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos
|
||||||
|
import net.minecraft.world.level.Level
|
||||||
|
import net.minecraft.world.level.block.EntityBlock
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityTicker
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||||
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
|
import net.minecraft.world.level.material.Material
|
||||||
|
import net.minecraft.world.level.material.MaterialColor
|
||||||
|
import ru.dbotthepony.mc.otm.block.entity.EnergyServoBlockEntity
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||||
|
|
||||||
|
class EnergyServoBlock : RotatableMatteryBlock(Properties.of(Material.METAL, MaterialColor.COLOR_BLUE).explosionResistance(12f).destroyTime(2f)), EntityBlock {
|
||||||
|
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
|
||||||
|
return EnergyServoBlockEntity(p_153215_, p_153216_)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun <T : BlockEntity?> getTicker(
|
||||||
|
p_153212_: Level,
|
||||||
|
p_153213_: BlockState,
|
||||||
|
p_153214_: BlockEntityType<T>
|
||||||
|
): BlockEntityTicker<T>? {
|
||||||
|
if (p_153214_ == MBlockEntities.ENERGY_SERVO && !p_153212_.isClientSide) {
|
||||||
|
return BlockEntityTicker { _, _, _, it -> if (it is EnergyServoBlockEntity) it.tick() }
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,155 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.block.entity
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos
|
||||||
|
import net.minecraft.core.Direction
|
||||||
|
import net.minecraft.nbt.CompoundTag
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.world.Container
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import net.minecraft.world.entity.player.Player
|
||||||
|
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
|
import net.minecraftforge.common.capabilities.Capability
|
||||||
|
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||||
|
import net.minecraftforge.common.util.LazyOptional
|
||||||
|
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||||
|
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||||
|
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||||
|
import ru.dbotthepony.mc.otm.capability.energy
|
||||||
|
import ru.dbotthepony.mc.otm.capability.energyStoredMattery
|
||||||
|
import ru.dbotthepony.mc.otm.capability.extractEnergy
|
||||||
|
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
|
||||||
|
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||||
|
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||||
|
import ru.dbotthepony.mc.otm.container.MatteryContainerFilter
|
||||||
|
import ru.dbotthepony.mc.otm.core.ImpreciseFraction
|
||||||
|
import ru.dbotthepony.mc.otm.core.map
|
||||||
|
import ru.dbotthepony.mc.otm.core.set
|
||||||
|
import ru.dbotthepony.mc.otm.menu.EnergyServoMenu
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||||
|
|
||||||
|
class EnergyServoBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryBlockEntity(MBlockEntities.ENERGY_SERVO, blockPos, blockState), IDroppableContainer {
|
||||||
|
override val defaultDisplayName: Component
|
||||||
|
get() = MBlocks.ENERGY_SERVO.name
|
||||||
|
|
||||||
|
val container = MatteryContainer(this::setChangedLight, 2)
|
||||||
|
|
||||||
|
override val droppableContainer: Container
|
||||||
|
get() = container
|
||||||
|
|
||||||
|
val itemHandler = container.handler(object : MatteryContainerFilter {
|
||||||
|
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
||||||
|
return when (slot) {
|
||||||
|
SLOT_DISCHARGE -> stack.isEmpty || stack.energy?.let { it.extractEnergy(Int.MAX_VALUE, true) > 0 } ?: false
|
||||||
|
SLOT_CHARGE -> stack.isEmpty || stack.energy?.let { it.receiveEnergy(Int.MAX_VALUE, true) > 0 } ?: false
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
||||||
|
return when (slot) {
|
||||||
|
SLOT_DISCHARGE -> stack.isEmpty || stack.energy?.let { it.extractEnergy(Int.MAX_VALUE, true) <= 0 } ?: false
|
||||||
|
SLOT_CHARGE -> stack.isEmpty || stack.energy?.let { it.receiveEnergy(Int.MAX_VALUE, true) <= 0 } ?: false
|
||||||
|
else -> false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
val energy = object : IMatteryEnergyStorage {
|
||||||
|
override fun extractEnergyOuter(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction {
|
||||||
|
return extractEnergyInner(howMuch, simulate)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun extractEnergyInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction {
|
||||||
|
return container[SLOT_DISCHARGE].energy?.extractEnergy(howMuch, simulate) ?: ImpreciseFraction.ZERO
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun receiveEnergyOuter(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction {
|
||||||
|
return receiveEnergyInner(howMuch, simulate)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun receiveEnergyInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction {
|
||||||
|
return container[SLOT_CHARGE].energy?.receiveEnergy(howMuch, simulate) ?: ImpreciseFraction.ZERO
|
||||||
|
}
|
||||||
|
|
||||||
|
override val batteryLevel: ImpreciseFraction
|
||||||
|
get() = container[SLOT_CHARGE].energy?.energyStoredMattery ?: container[SLOT_DISCHARGE].energy?.energyStoredMattery ?: ImpreciseFraction.ZERO
|
||||||
|
|
||||||
|
override val maxBatteryLevel: ImpreciseFraction
|
||||||
|
get() = container[SLOT_CHARGE].energy?.maxEnergyStoredMattery ?: container[SLOT_DISCHARGE].energy?.maxEnergyStoredMattery ?: ImpreciseFraction.ZERO
|
||||||
|
}
|
||||||
|
|
||||||
|
private var resolverEnergy = LazyOptional.of { energy }
|
||||||
|
private var valid = true
|
||||||
|
|
||||||
|
override fun invalidateCaps() {
|
||||||
|
super.invalidateCaps()
|
||||||
|
valid = false
|
||||||
|
resolverEnergy.invalidate()
|
||||||
|
itemHandler.invalidate()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun reviveCaps() {
|
||||||
|
super.reviveCaps()
|
||||||
|
valid = true
|
||||||
|
resolverEnergy = LazyOptional.of { energy }
|
||||||
|
itemHandler.revive()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||||
|
return EnergyServoMenu(containerID, inventory, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun <T : Any?> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> {
|
||||||
|
if (valid) {
|
||||||
|
when (cap) {
|
||||||
|
MatteryCapability.ENERGY, ForgeCapabilities.ENERGY -> return resolverEnergy.cast()
|
||||||
|
ForgeCapabilities.ITEM_HANDLER -> return itemHandler.get().cast()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.getCapability(cap, side)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun saveAdditional(nbt: CompoundTag) {
|
||||||
|
super.saveAdditional(nbt)
|
||||||
|
|
||||||
|
nbt[INVENTORY_KEY] = container.serializeNBT()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun load(nbt: CompoundTag) {
|
||||||
|
super.load(nbt)
|
||||||
|
nbt.map(INVENTORY_KEY, container::deserializeNBT)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun tick() {
|
||||||
|
val charge = container[SLOT_CHARGE]
|
||||||
|
val discharge = container[SLOT_DISCHARGE]
|
||||||
|
|
||||||
|
if (!charge.isEmpty && !discharge.isEmpty) {
|
||||||
|
val chargeEnergy = charge.energy ?: return
|
||||||
|
val dischargeEnergy = discharge.energy ?: return
|
||||||
|
|
||||||
|
val extracted = dischargeEnergy.extractEnergy(ImpreciseFraction.LONG_MAX_VALUE, true)
|
||||||
|
|
||||||
|
if (extracted.isPositive) {
|
||||||
|
val received = chargeEnergy.receiveEnergy(extracted, true)
|
||||||
|
|
||||||
|
if (received.isPositive) {
|
||||||
|
val extracted2 = dischargeEnergy.extractEnergy(received, false)
|
||||||
|
|
||||||
|
if (extracted2 == received) {
|
||||||
|
chargeEnergy.receiveEnergy(dischargeEnergy.extractEnergy(received, false), false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val SLOT_DISCHARGE = 0
|
||||||
|
const val SLOT_CHARGE = 1
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.client.screen
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.panels.AbstractSlotPanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.panels.BatterySlotPanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.widget.HorizontalPowerGaugePanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.widget.ProgressGaugePanel
|
||||||
|
import ru.dbotthepony.mc.otm.client.screen.widget.TallHorizontalPowerGaugePanel
|
||||||
|
import ru.dbotthepony.mc.otm.menu.EnergyServoMenu
|
||||||
|
|
||||||
|
class EnergyServoScreen(menu: EnergyServoMenu, inventory: Inventory, title: Component) : MatteryScreen<EnergyServoMenu>(menu, inventory, title) {
|
||||||
|
override fun makeMainFrame(): FramePanel<MatteryScreen<*>>? {
|
||||||
|
val frame = FramePanel.padded(this,
|
||||||
|
width = AbstractSlotPanel.SIZE * 2f + HorizontalPowerGaugePanel.GAUGE_BACKGROUND_TALL.width + 8f + ProgressGaugePanel.GAUGE_BACKGROUND.width * 2f,
|
||||||
|
AbstractSlotPanel.SIZE, title)
|
||||||
|
|
||||||
|
BatterySlotPanel(this, frame, menu.dischargeSlot).also {
|
||||||
|
it.dock = Dock.LEFT
|
||||||
|
it.dockRight = 2f
|
||||||
|
}
|
||||||
|
|
||||||
|
object : EditablePanel<EnergyServoScreen>(this@EnergyServoScreen, frame) {
|
||||||
|
init {
|
||||||
|
dock = Dock.LEFT
|
||||||
|
dockRight = 2f
|
||||||
|
dockTop = 2f
|
||||||
|
width = ProgressGaugePanel.GAUGE_BACKGROUND.width
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun innerRender(stack: PoseStack, mouseX: Float, mouseY: Float, partialTick: Float) {
|
||||||
|
ProgressGaugePanel.GAUGE_BACKGROUND.render(stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TallHorizontalPowerGaugePanel(this, frame, menu.powerGauge).also {
|
||||||
|
it.dock = Dock.LEFT
|
||||||
|
it.dockRight = 2f
|
||||||
|
}
|
||||||
|
|
||||||
|
object : EditablePanel<EnergyServoScreen>(this@EnergyServoScreen, frame) {
|
||||||
|
init {
|
||||||
|
dock = Dock.LEFT
|
||||||
|
dockRight = 2f
|
||||||
|
dockTop = 2f
|
||||||
|
width = ProgressGaugePanel.GAUGE_BACKGROUND.width
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun innerRender(stack: PoseStack, mouseX: Float, mouseY: Float, partialTick: Float) {
|
||||||
|
ProgressGaugePanel.GAUGE_BACKGROUND.render(stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BatterySlotPanel(this, frame, menu.chargeSlot).also {
|
||||||
|
it.dock = Dock.LEFT
|
||||||
|
it.dockRight
|
||||||
|
}
|
||||||
|
|
||||||
|
return frame
|
||||||
|
}
|
||||||
|
}
|
@ -206,6 +206,13 @@ open class FramePanel<out S : Screen>(
|
|||||||
title: Component
|
title: Component
|
||||||
) = FramePanel(screen, parent, 0f, 0f, width + PADDING * 2, height + PADDING_TOP + PADDING, title)
|
) = FramePanel(screen, parent, 0f, 0f, width + PADDING * 2, height + PADDING_TOP + PADDING, title)
|
||||||
|
|
||||||
|
fun <S : Screen> padded(
|
||||||
|
screen: S,
|
||||||
|
width: Float,
|
||||||
|
height: Float,
|
||||||
|
title: Component
|
||||||
|
) = FramePanel(screen, null, 0f, 0f, width + PADDING * 2, height + PADDING_TOP + PADDING, title)
|
||||||
|
|
||||||
const val PADDING = 8f
|
const val PADDING = 8f
|
||||||
const val PADDING_TOP = 14f
|
const val PADDING_TOP = 14f
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ fun CompoundTag.contains(vararg keys: String): Boolean {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <R, reified T : Tag> CompoundTag.map(key: String, consumer: (T) -> R): R? {
|
inline fun <R, reified T : Tag?> CompoundTag.map(key: String, consumer: (T) -> R): R? {
|
||||||
val tag = get(key)
|
val tag = get(key)
|
||||||
|
|
||||||
if (tag is T) {
|
if (tag is T) {
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package ru.dbotthepony.mc.otm.menu
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableList
|
||||||
|
import net.minecraft.world.SimpleContainer
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import net.minecraft.world.inventory.Slot
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
|
import ru.dbotthepony.mc.otm.block.entity.EnergyServoBlockEntity
|
||||||
|
import ru.dbotthepony.mc.otm.capability.energy
|
||||||
|
import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget
|
||||||
|
import ru.dbotthepony.mc.otm.registry.MMenus
|
||||||
|
|
||||||
|
class EnergyServoMenu @JvmOverloads constructor(
|
||||||
|
p_38852_: Int,
|
||||||
|
inventory: Inventory,
|
||||||
|
tile: EnergyServoBlockEntity? = null
|
||||||
|
) : MatteryMenu(MMenus.ENERGY_SERVO, p_38852_, inventory, tile) {
|
||||||
|
val dischargeSlot: MatterySlot
|
||||||
|
val chargeSlot: MatterySlot
|
||||||
|
|
||||||
|
val powerGauge = LevelGaugeWidget(this, tile?.energy)
|
||||||
|
|
||||||
|
init {
|
||||||
|
val container = tile?.container ?: SimpleContainer(2)
|
||||||
|
|
||||||
|
dischargeSlot = object : MatterySlot(container, EnergyServoBlockEntity.SLOT_DISCHARGE) {
|
||||||
|
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||||
|
return super.mayPlace(p_40231_) && (p_40231_.energy?.let { it.extractEnergy(Int.MAX_VALUE, true) > 0 } ?: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
chargeSlot = object : MatterySlot(container, EnergyServoBlockEntity.SLOT_CHARGE) {
|
||||||
|
override fun mayPlace(p_40231_: ItemStack): Boolean {
|
||||||
|
return super.mayPlace(p_40231_) && (p_40231_.energy?.let { it.receiveEnergy(Int.MAX_VALUE, true) > 0 } ?: false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addSlot(dischargeSlot)
|
||||||
|
addSlot(chargeSlot)
|
||||||
|
addInventorySlots()
|
||||||
|
}
|
||||||
|
|
||||||
|
override val storageSlots: Collection<Slot> = ImmutableList.of(dischargeSlot, chargeSlot)
|
||||||
|
}
|
@ -44,6 +44,7 @@ object MBlockEntities {
|
|||||||
val PLATE_PRESS: BlockEntityType<*> by registry.register(MNames.PLATE_PRESS) { BlockEntityType.Builder.of(::PlatePressBlockEntity, MBlocks.PLATE_PRESS).build(null) }
|
val PLATE_PRESS: BlockEntityType<*> by registry.register(MNames.PLATE_PRESS) { BlockEntityType.Builder.of(::PlatePressBlockEntity, MBlocks.PLATE_PRESS).build(null) }
|
||||||
val GRAVITATION_STABILIZER: BlockEntityType<*> by registry.register(MNames.GRAVITATION_STABILIZER) { BlockEntityType.Builder.of(::GravitationStabilizerBlockEntity, MBlocks.GRAVITATION_STABILIZER).build(null) }
|
val GRAVITATION_STABILIZER: BlockEntityType<*> by registry.register(MNames.GRAVITATION_STABILIZER) { BlockEntityType.Builder.of(::GravitationStabilizerBlockEntity, MBlocks.GRAVITATION_STABILIZER).build(null) }
|
||||||
val MATTER_RECYCLER: BlockEntityType<*> by registry.register(MNames.MATTER_RECYCLER) { BlockEntityType.Builder.of(::MatterRecyclerBlockEntity, MBlocks.MATTER_RECYCLER).build(null) }
|
val MATTER_RECYCLER: BlockEntityType<*> by registry.register(MNames.MATTER_RECYCLER) { BlockEntityType.Builder.of(::MatterRecyclerBlockEntity, MBlocks.MATTER_RECYCLER).build(null) }
|
||||||
|
val ENERGY_SERVO: BlockEntityType<*> by registry.register(MNames.ENERGY_SERVO) { BlockEntityType.Builder.of(::EnergyServoBlockEntity, MBlocks.ENERGY_SERVO).build(null) }
|
||||||
|
|
||||||
val STORAGE_BUS: BlockEntityType<*> by registry.register(MNames.STORAGE_BUS) { BlockEntityType.Builder.of(::StorageBusBlockEntity, MBlocks.STORAGE_BUS).build(null) }
|
val STORAGE_BUS: BlockEntityType<*> by registry.register(MNames.STORAGE_BUS) { BlockEntityType.Builder.of(::StorageBusBlockEntity, MBlocks.STORAGE_BUS).build(null) }
|
||||||
val STORAGE_IMPORTER: BlockEntityType<*> by registry.register(MNames.STORAGE_IMPORTER) { BlockEntityType.Builder.of(::StorageImporterBlockEntity, MBlocks.STORAGE_IMPORTER).build(null) }
|
val STORAGE_IMPORTER: BlockEntityType<*> by registry.register(MNames.STORAGE_IMPORTER) { BlockEntityType.Builder.of(::StorageImporterBlockEntity, MBlocks.STORAGE_IMPORTER).build(null) }
|
||||||
|
@ -38,6 +38,7 @@ object MBlocks {
|
|||||||
val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() }
|
val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() }
|
||||||
val PLATE_PRESS: Block by registry.register(MNames.PLATE_PRESS) { PlatePressBlock() }
|
val PLATE_PRESS: Block by registry.register(MNames.PLATE_PRESS) { PlatePressBlock() }
|
||||||
val MATTER_RECYCLER: Block by registry.register(MNames.MATTER_RECYCLER) { MatterRecyclerBlock() }
|
val MATTER_RECYCLER: Block by registry.register(MNames.MATTER_RECYCLER) { MatterRecyclerBlock() }
|
||||||
|
val ENERGY_SERVO: Block by registry.register(MNames.ENERGY_SERVO) { EnergyServoBlock() }
|
||||||
|
|
||||||
val STORAGE_BUS: Block by registry.register(MNames.STORAGE_BUS) { StorageBusBlock() }
|
val STORAGE_BUS: Block by registry.register(MNames.STORAGE_BUS) { StorageBusBlock() }
|
||||||
val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER) { StorageImporterBlock() }
|
val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER) { StorageImporterBlock() }
|
||||||
|
@ -68,10 +68,10 @@ object MItems {
|
|||||||
) {
|
) {
|
||||||
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
|
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
|
||||||
|
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.GRAVITATION_STABILIZER}.desc").withStyle(ChatFormatting.GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.GRAVITATION_STABILIZER.descriptionId}.desc").withStyle(ChatFormatting.GRAY))
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.GRAVITATION_STABILIZER}.desc2").withStyle(ChatFormatting.DARK_GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.GRAVITATION_STABILIZER.descriptionId}.desc2").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.GRAVITATION_STABILIZER}.desc3").withStyle(ChatFormatting.DARK_GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.GRAVITATION_STABILIZER.descriptionId}.desc3").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.GRAVITATION_STABILIZER}.desc4").withStyle(ChatFormatting.DARK_GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.GRAVITATION_STABILIZER.descriptionId}.desc4").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -86,8 +86,23 @@ object MItems {
|
|||||||
) {
|
) {
|
||||||
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
|
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
|
||||||
|
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.PHANTOM_ATTRACTOR}.desc").withStyle(ChatFormatting.GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.PHANTOM_ATTRACTOR.descriptionId}.desc").withStyle(ChatFormatting.GRAY))
|
||||||
p_40574_.add(TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.PHANTOM_ATTRACTOR}.desc2").withStyle(ChatFormatting.DARK_GRAY))
|
p_40574_.add(TranslatableComponent("${MBlocks.PHANTOM_ATTRACTOR.descriptionId}.desc2").withStyle(ChatFormatting.DARK_GRAY))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val ENERGY_SERVO: Item by registry.register(MNames.ENERGY_SERVO) {
|
||||||
|
object : BlockItem(MBlocks.ENERGY_SERVO, DEFAULT_PROPERTIES){
|
||||||
|
override fun appendHoverText(
|
||||||
|
p_40572_: ItemStack,
|
||||||
|
p_40573_: Level?,
|
||||||
|
p_40574_: MutableList<Component>,
|
||||||
|
p_40575_: TooltipFlag
|
||||||
|
) {
|
||||||
|
super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_)
|
||||||
|
|
||||||
|
p_40574_.add(TranslatableComponent("${MBlocks.ENERGY_SERVO.descriptionId}.desc").withStyle(ChatFormatting.GRAY))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ object MMenus {
|
|||||||
val CHEMICAL_GENERATOR: MenuType<*> by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu) }
|
val CHEMICAL_GENERATOR: MenuType<*> by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu) }
|
||||||
val PLATE_PRESS: MenuType<*> by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu) }
|
val PLATE_PRESS: MenuType<*> by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu) }
|
||||||
val MATTER_RECYCLER: MenuType<*> by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu) }
|
val MATTER_RECYCLER: MenuType<*> by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu) }
|
||||||
|
val ENERGY_SERVO: MenuType<*> by registry.register(MNames.ENERGY_SERVO) { MenuType(::EnergyServoMenu) }
|
||||||
|
|
||||||
val STORAGE_BUS: MenuType<*> by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu) }
|
val STORAGE_BUS: MenuType<*> by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu) }
|
||||||
val STORAGE_EXPORTER: MenuType<*> by registry.register(MNames.STORAGE_EXPORTER) { MenuType(::StorageExporterMenu) }
|
val STORAGE_EXPORTER: MenuType<*> by registry.register(MNames.STORAGE_EXPORTER) { MenuType(::StorageExporterMenu) }
|
||||||
@ -66,6 +67,7 @@ object MMenus {
|
|||||||
MenuScreens.register(STORAGE_EXPORTER as MenuType<StorageExporterMenu>, ::StorageExporterScreen)
|
MenuScreens.register(STORAGE_EXPORTER as MenuType<StorageExporterMenu>, ::StorageExporterScreen)
|
||||||
MenuScreens.register(STORAGE_IMPORTER as MenuType<StorageImporterMenu>, ::StorageImporterScreen)
|
MenuScreens.register(STORAGE_IMPORTER as MenuType<StorageImporterMenu>, ::StorageImporterScreen)
|
||||||
MenuScreens.register(STORAGE_POWER_SUPPLIER as MenuType<StoragePowerSupplierMenu>, ::StoragePowerSupplierScreen)
|
MenuScreens.register(STORAGE_POWER_SUPPLIER as MenuType<StoragePowerSupplierMenu>, ::StoragePowerSupplierScreen)
|
||||||
|
MenuScreens.register(ENERGY_SERVO as MenuType<EnergyServoMenu>, ::EnergyServoScreen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,23 +11,24 @@ object MNames {
|
|||||||
const val METAL_BEAM = "metal_beam"
|
const val METAL_BEAM = "metal_beam"
|
||||||
|
|
||||||
// blocks
|
// blocks
|
||||||
const val ANDROID_STATION = "android_station" // без рецепта
|
const val ANDROID_STATION = "android_station"
|
||||||
const val BATTERY_BANK = "battery_bank" // нужен рецепт
|
const val BATTERY_BANK = "battery_bank"
|
||||||
const val MATTER_DECOMPOSER = "matter_decomposer" // есть рецепт
|
const val MATTER_DECOMPOSER = "matter_decomposer"
|
||||||
const val MATTER_CAPACITOR_BANK = "matter_capacitor_bank" // есть рецепт
|
const val MATTER_CAPACITOR_BANK = "matter_capacitor_bank"
|
||||||
const val MATTER_CABLE = "matter_cable" // есть рецепт
|
const val MATTER_CABLE = "matter_cable"
|
||||||
const val PATTERN_STORAGE = "pattern_storage" // есть рецепт
|
const val PATTERN_STORAGE = "pattern_storage"
|
||||||
const val MATTER_SCANNER = "matter_scanner" // есть рецепт
|
const val MATTER_SCANNER = "matter_scanner"
|
||||||
const val MATTER_PANEL = "matter_panel" // есть рецепт
|
const val MATTER_PANEL = "matter_panel"
|
||||||
const val MATTER_REPLICATOR = "matter_replicator" // есть рецепт
|
const val MATTER_REPLICATOR = "matter_replicator"
|
||||||
const val MATTER_BOTTLER = "matter_bottler" // есть рецепт
|
const val MATTER_BOTTLER = "matter_bottler"
|
||||||
const val DRIVE_VIEWER = "drive_viewer" // есть рецепт
|
const val DRIVE_VIEWER = "drive_viewer"
|
||||||
const val DRIVE_RACK = "drive_rack" // нужен рецепт (после улучшений)
|
const val DRIVE_RACK = "drive_rack"
|
||||||
const val ITEM_MONITOR = "item_monitor" // нужен рецепт (после улучшений)
|
const val ITEM_MONITOR = "item_monitor"
|
||||||
const val ENERGY_COUNTER = "energy_counter" // есть рецепт
|
const val ENERGY_COUNTER = "energy_counter"
|
||||||
const val CHEMICAL_GENERATOR = "chemical_generator" // есть рецепт
|
const val CHEMICAL_GENERATOR = "chemical_generator"
|
||||||
const val PLATE_PRESS = "plate_press" // есть рецепт
|
const val PLATE_PRESS = "plate_press"
|
||||||
const val MATTER_RECYCLER = "matter_recycler" // нужен рецепт
|
const val MATTER_RECYCLER = "matter_recycler"
|
||||||
|
const val ENERGY_SERVO = "energy_servo"
|
||||||
|
|
||||||
const val STORAGE_CABLE = "storage_cable" // нужен рецепт
|
const val STORAGE_CABLE = "storage_cable" // нужен рецепт
|
||||||
const val STORAGE_POWER_SUPPLIER = "storage_power_supplier" // нужен рецепт
|
const val STORAGE_POWER_SUPPLIER = "storage_power_supplier" // нужен рецепт
|
||||||
|
Loading…
Reference in New Issue
Block a user