diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt index 1b3dd6e29..d1edbc3cb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/AndroidStationBlockEntity.kt @@ -23,9 +23,8 @@ class AndroidStationBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : return AndroidStationMenu(containerID, inventory, this) } - override fun getDefaultDisplayName(): Component { - return MACHINE_NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt index f552cb152..4140a31af 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt @@ -26,7 +26,6 @@ import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.ifPresentK import ru.dbotthepony.mc.otm.menu.BatteryBankMenu -import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.unaryMinus @@ -213,9 +212,8 @@ class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte super.load(nbt) } - override fun getDefaultDisplayName(): Component { - return MACHINE_NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return BatteryBankMenu(containerID, inventory, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt index d492104c0..fcc7e3e6a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/CargoCrateBlockEntity.kt @@ -67,16 +67,15 @@ class CargoCrateBlockEntity( nbt.ifHas("slots", CompoundTag::class.java, container::deserializeNBT) } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return CargoCrateMenu(containerID, inventory, this) } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.cargo_crate") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.cargo_crate") const val CAPACITY = 9 * 6 } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt index 02fab4001..1790b2847 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ChemicalGeneratorBlockEntity.kt @@ -31,9 +31,8 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.lang.ref.WeakReference class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBlockEntity(MBlockEntities.CHEMICAL_GENERATOR, pos, state) { - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return ChemicalGeneratorMenu(containerID, inventory, this) @@ -238,7 +237,7 @@ class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBl private const val THROUGHPUT_INT = 160 private val GENERATION_SPEED = ImpreciseFraction(40) private val MAX_ENERGY = ImpreciseFraction(24_000) - private val NAME = TranslatableComponent("block.overdrive_that_matters.chemical_generator") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.chemical_generator") const val SLOT_INPUT = 0 const val SLOT_BATTERY = 1 diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt index 839ff4c0f..0f4f7ae67 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt @@ -71,9 +71,8 @@ class DriveRackBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : batteryChargeLoop() } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { return DriveRackMenu(containerID, inventory, this) @@ -96,7 +95,7 @@ class DriveRackBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.drive_rack") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.drive_rack") private val STORAGE = ImpreciseFraction(80_000) } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt index a7af6ffc1..6f81dc6b1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt @@ -68,9 +68,8 @@ class DriveViewerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte } } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { return DriveViewerMenu(containerID, inventory, this) @@ -92,6 +91,6 @@ class DriveViewerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.drive_viewer") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.drive_viewer") } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt index d38702d3d..edb4bf8e0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/EnergyCounterBlockEntity.kt @@ -163,9 +163,8 @@ class EnergyCounterBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mat } } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return EnergyCounterMenu(containerID, inventory, this) @@ -471,6 +470,6 @@ class EnergyCounterBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mat } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.energy_counter") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.energy_counter") } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt index 596ea9975..c1bf8aa28 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/GravitationStabilizerBlockEntity.kt @@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.block.entity import net.minecraft.core.BlockPos import net.minecraft.core.SectionPos +import net.minecraft.network.chat.Component import net.minecraft.network.chat.TranslatableComponent import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player @@ -20,7 +21,10 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities class GravitationStabilizerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity( MBlockEntities.GRAVITATION_STABILIZER, p_155229_, p_155230_) { - override fun getDefaultDisplayName() = NAME + + override val defaultDisplayName: Component + get() = MACHINE_NAME + override fun createMenu(containerID: Int, inventory: Inventory, ply: Player) = null private var blackHole: BlackHoleBlockEntity? = null @@ -78,6 +82,6 @@ class GravitationStabilizerBlockEntity(p_155229_: BlockPos, p_155230_: BlockStat companion object { private val minBBox = BlockPos(1, 1, 1) const val RANGE = 64 - private val NAME = TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer") } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt index 31ff5bd04..45350a258 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt @@ -30,9 +30,8 @@ class ItemMonitorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : batteryChargeLoop() } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return ItemMonitorMenu(containerID, inventory, this) @@ -62,6 +61,6 @@ class ItemMonitorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.item_monitor") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.item_monitor") } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt index 5256bcbac..47331406f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt @@ -162,9 +162,8 @@ class MatterBottlerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : return super.getCapability(cap, side) } - override fun getDefaultDisplayName(): Component { - return MACHINE_NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterBottlerMenu(containerID, inventory, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt index 52d2a32be..493affe74 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt @@ -71,7 +71,7 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) } override fun receiveMatterInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction { - var howMuch = howMuch + @Suppress("NAME_SHADOWING") var howMuch = howMuch var summ = ImpreciseFraction.ZERO for (stack in container) { @@ -96,7 +96,7 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) } override fun extractMatterInner(howMuch: ImpreciseFraction, simulate: Boolean): ImpreciseFraction { - var howMuch = howMuch + @Suppress("NAME_SHADOWING") var howMuch = howMuch var summ = ImpreciseFraction.ZERO for (stack in container) { @@ -148,9 +148,8 @@ class MatterCapacitorBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.matter_capacitor_bank") } - override fun getDefaultDisplayName(): Component { - return MACHINE_NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun saveAdditional(nbt: CompoundTag) { super.saveAdditional(nbt) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt index 2ab876ac4..38a4310d8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt @@ -123,9 +123,8 @@ class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState) { slot: Int, _: Int, _: ItemStack -> slot != INPUT_SLOT }) } - override fun getDefaultDisplayName(): Component { - return MACHINE_NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterDecomposerMenu(containerID, inventory, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt index 33ba140f9..4b912f6ee 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt @@ -49,9 +49,8 @@ class MatterPanelBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : listeners.remove(menu) } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterPanelMenu(containerID, inventory, this) @@ -219,6 +218,6 @@ class MatterPanelBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.matter_panel") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.matter_panel") } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt index 9ddec003c..e49d8be0c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt @@ -3,6 +3,7 @@ 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.network.chat.TranslatableComponent import net.minecraft.server.level.ServerLevel import net.minecraft.world.entity.player.Inventory @@ -119,7 +120,8 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState) return super.getCapability(cap, side) } - override fun getDefaultDisplayName() = NAME + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterRecyclerMenu(containerID, inventory, this) @@ -174,7 +176,7 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState) } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.matter_recycler") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.matter_recycler") private val STORAGE = ImpreciseFraction(40) private val POWER_CONSUMPTION = ImpreciseFraction(80) private val MAX_POWER = ImpreciseFraction(80_000) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt index 6d4f05c73..d4f655db3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt @@ -57,9 +57,8 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : val container = MatteryContainer(this::setChangedLight, 5) private val itemHandler = container.handler(MatteryContainerFilterOnlyOut) - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterReplicatorMenu(containerID, inventory, this) @@ -226,7 +225,7 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.matter_replicator") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.matter_replicator") private val BASE_CONSUMPTION = ImpreciseFraction(400) private val DRAIN_MULT = ImpreciseFraction(200) private val STORAGE = ImpreciseFraction(200_000) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt index 5a405a023..56cba3cdf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt @@ -92,9 +92,8 @@ class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : matterNode.destroy(::MatterNetworkGraph) } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return MatterScannerMenu(containerID, inventory, this) @@ -187,7 +186,7 @@ class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.matter_scanner") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.matter_scanner") private val BASE_CONSUMPTION = ImpreciseFraction("40") private val STORAGE = ImpreciseFraction(80_000) private val MAX_IO = ImpreciseFraction(400) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt index c383ecdf2..31ca49146 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt @@ -65,7 +65,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc } } - protected abstract fun getDefaultDisplayName(): Component + protected abstract val defaultDisplayName: Component abstract override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? protected fun tickOnce(func: Runnable) { @@ -122,7 +122,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc } override fun getDisplayName(): Component { - return customDisplayName ?: getDefaultDisplayName() + return customDisplayName ?: defaultDisplayName } protected open fun redstoneStatusUpdated(new_blocked: Boolean, old_blocked: Boolean) {} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt index e4d86cb50..cbc1e06d1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt @@ -142,9 +142,8 @@ class PatternStorageBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : return super.getCapability(cap, side) } - override fun getDefaultDisplayName(): Component { - return NAME - } + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return PatternStorageMenu(containerID, inventory, this) @@ -206,6 +205,6 @@ class PatternStorageBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } companion object { - private val NAME = TranslatableComponent("block.overdrive_that_matters.pattern_storage") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.pattern_storage") } } \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt index f40d43374..1ddddf8f5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PlatePressBlockEntity.kt @@ -3,6 +3,7 @@ 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.network.chat.TranslatableComponent import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player @@ -65,7 +66,8 @@ class PlatePressBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matter container.deserializeNBT(nbt["container"]) } - override fun getDefaultDisplayName() = NAME + override val defaultDisplayName: Component + get() = MACHINE_NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return PlatePressMenu(containerID, inventory, this) @@ -101,7 +103,7 @@ class PlatePressBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matter companion object { private val BASELINE_CONSUMPTION = ImpreciseFraction(15) - private val NAME = TranslatableComponent("block.overdrive_that_matters.plate_press") + private val MACHINE_NAME = TranslatableComponent("block.overdrive_that_matters.plate_press") const val SLOT_INPUT = 0 const val SLOT_OUTPUT = 1 }