diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index 5918402bb..aabfca251 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.block.DriveViewerBlock import ru.dbotthepony.mc.otm.block.EnergyCounterBlock -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.PatternStorageBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.data.LootTableBasicAppender @@ -254,12 +254,12 @@ object DataGen { blockStateProvider.lambda { provider -> with(provider.getMultipartBuilder(MBlocks.DRIVE_VIEWER)) { - for (facing in BlockMatteryRotatable.FACING.possibleValues) { + for (facing in RotatableMatteryBlock.FACING.possibleValues) { part() .modelFile(provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/drive_viewer_drive_part"))) .rotationY(facing.toYRotBlockstate()) .addModel() - .condition(BlockMatteryRotatable.FACING, facing) + .condition(RotatableMatteryBlock.FACING, facing) .condition(DriveViewerBlock.DRIVE_PRESENT, true) for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) { @@ -268,19 +268,19 @@ object DataGen { .rotationY(facing.toYRotBlockstate()) .addModel() .condition(WorkerState.SEMI_WORKER_STATE, workState) - .condition(BlockMatteryRotatable.FACING, facing) + .condition(RotatableMatteryBlock.FACING, facing) } } } with(provider.getMultipartBuilder(MBlocks.PATTERN_STORAGE)) { - for (facing in BlockMatteryRotatable.FACING.possibleValues) { + for (facing in RotatableMatteryBlock.FACING.possibleValues) { for (i in 0 .. 7) { part() .modelFile(provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/pattern/model$i"))) .rotationY(facing.toYRotBlockstate()) .addModel() - .condition(BlockMatteryRotatable.FACING, facing) + .condition(RotatableMatteryBlock.FACING, facing) .condition(PatternStorageBlock.PATTERN_STORAGE_DISKS_PROPS[i], true) } @@ -288,7 +288,7 @@ object DataGen { .modelFile(provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/pattern_storage"))) .rotationY(facing.toYRotBlockstate()) .addModel() - .condition(BlockMatteryRotatable.FACING, facing) + .condition(RotatableMatteryBlock.FACING, facing) } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt index a327b20a5..50b43f3e9 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt @@ -5,7 +5,7 @@ import net.minecraft.world.level.block.Block import net.minecraftforge.client.model.generators.BlockStateProvider import net.minecraftforge.forge.event.lifecycle.GatherDataEvent import ru.dbotthepony.mc.otm.block.BatteryBankBlock -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.toYRotBlockstate import ru.dbotthepony.mc.otm.registry.MBlocks @@ -26,15 +26,15 @@ open class BatteryBankProvider(event: GatherDataEvent) : BlockStateProvider(even with(getMultipartBuilder(registry)) { val battery_bank = models().getExistingFile(ResourceLocation("overdrive_that_matters:block/$block")) - BlockMatteryRotatable.FACING.possibleValues.forEach { + RotatableMatteryBlock.FACING.possibleValues.forEach { part().modelFile(battery_bank).rotationY(it.toYRotBlockstate()).addModel().condition( - BlockMatteryRotatable.FACING, it) + RotatableMatteryBlock.FACING, it) for (i in 0 .. 11) { part().modelFile( models().getExistingFile(ResourceLocation("overdrive_that_matters:$batteryPath$i")) ).rotationY(it.toYRotBlockstate()).addModel() - .condition(BlockMatteryRotatable.FACING, it) + .condition(RotatableMatteryBlock.FACING, it) .condition(BatteryBankBlock.BATTERY_SLOTS_PROPS[i], true) } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt index 3c9e02b81..4389884ec 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/MatteryBlockStateProvider.kt @@ -6,8 +6,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.client.model.generators.BlockStateProvider import net.minecraftforge.client.model.generators.ConfiguredModel import net.minecraftforge.forge.event.lifecycle.GatherDataEvent -import ru.dbotthepony.mc.otm.block.BlockMattery -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.getValueNullable @@ -20,11 +19,11 @@ private data class AdvancedBlockStateEntry(val block: Block, val func: AdvancedB private fun initialTransform(it: BlockState, modelPath: String, builder: ConfiguredModel.Builder<*>): String { @Suppress("NAME_SHADOWING") var modelPath = modelPath - it.getValueNullable(BlockMatteryRotatable.FACING)?.let { + it.getValueNullable(RotatableMatteryBlock.FACING)?.let { builder.rotationY(it.toYRotBlockstate()) } - it.getValueNullable(BlockMatteryRotatable.FACING_FULL)?.let { + it.getValueNullable(RotatableMatteryBlock.FACING_FULL)?.let { builder.rotationY(it.toYRotBlockstate()) builder.rotationX(it.toXRotBlockstate()) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt index 894b0eecd..0d6e04409 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/AndroidStationBlock.kt @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.orNull import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class AndroidStationBlock : BlockMattery(), EntityBlock { +class AndroidStationBlock : MatteryBlock(), EntityBlock { override fun use( blockState: BlockState, level: Level, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt index 9765ec9fd..f280758b8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BatteryBankBlock.kt @@ -23,7 +23,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BatteryBankBlock : BlockMatteryRotatable(), EntityBlock { +class BatteryBankBlock : RotatableMatteryBlock(), EntityBlock { override fun getStateForPlacement(context: BlockPlaceContext): BlockState { var state = super.getStateForPlacement(context)!! diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt index 5044772db..bb3b0593e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/CargoCrateBlock.kt @@ -13,7 +13,7 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import ru.dbotthepony.mc.otm.block.entity.CargoCrateBlockEntity -class CargoCrateBlock : BlockMatteryRotatable(), EntityBlock { +class CargoCrateBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return CargoCrateBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt index ec03eef59..99943fcdb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ChemicalGeneratorBlock.kt @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.tickOnceServer -class ChemicalGeneratorBlock : BlockMatteryRotatable(), EntityBlock { +class ChemicalGeneratorBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return ChemicalGeneratorBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt index af23218f2..7488c4cd3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt @@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class DriveRackBlock : BlockMatteryRotatable(), EntityBlock { +class DriveRackBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return DriveRackBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt index 2d2aa1f81..d579bad01 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt @@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities -class DriveViewerBlock : BlockMatteryRotatable(), EntityBlock { +class DriveViewerBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return DriveViewerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt index 16444235f..50b2178cd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/EnergyCounterBlock.kt @@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.block.entity.EnergyCounterBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EnergyCounterBlock : BlockMattery(), EntityBlock { +class EnergyCounterBlock : MatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return EnergyCounterBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt index 4d67e50e4..58013eadd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/GravitationStabilizerBlock.kt @@ -35,7 +35,7 @@ import kotlin.math.PI private val props = BlockBehaviour.Properties.of(Material.STONE, MaterialColor.COLOR_BLUE).requiresCorrectToolForDrops().strength(3f, 600.0f) -class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { +class BlockGravitationStabilizer : RotatableMatteryBlock(props), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return GravitationStabilizerBlockEntity(p_153215_, p_153216_) } @@ -159,7 +159,7 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { } } -class BlockGravitationStabilizerLens : BlockMatteryRotatable(props) { +class BlockGravitationStabilizerLens : RotatableMatteryBlock(props) { override val hasFreeRotation: Boolean get() = true override fun createBlockStateDefinition(builder: StateDefinition.Builder) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt index dd22a7564..9fc48db85 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt @@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class ItemMonitorBlock : BlockMatteryRotatable(), EntityBlock { +class ItemMonitorBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return ItemMonitorBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt index b8cb60e0f..75f280ae8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt @@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class MatterBottlerBlock : BlockMatteryRotatable(), EntityBlock { +class MatterBottlerBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { return MatterBottlerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt index e0b939c12..091694c5f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt @@ -14,7 +14,7 @@ import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterCapacitorBankBlock : BlockMatteryRotatable(), EntityBlock { +class MatterCapacitorBankBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterCapacitorBankBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt index 4ffdce684..6184ab7dd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt @@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class MatterDecomposerBlock : BlockMatteryRotatable(), EntityBlock { +class MatterDecomposerBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterDecomposerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt index acd1dc11e..f21c23b21 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt @@ -16,7 +16,7 @@ import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.properties.EnumProperty -class MatterPanelBlock : BlockMattery(), EntityBlock { +class MatterPanelBlock : MatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterPanelBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt index 77c7f3f6d..926cdcd0f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt @@ -13,7 +13,7 @@ import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities -class MatterRecyclerBlock : BlockMatteryRotatable(), EntityBlock { +class MatterRecyclerBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return MatterRecyclerBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt index 1e6e99538..dee4c6514 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt @@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterReplicatorBlock : BlockMatteryRotatable(), EntityBlock { +class MatterReplicatorBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterReplicatorBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt index 8dfa29933..71632ccf5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt @@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterScannerBlock : BlockMatteryRotatable(), EntityBlock { +class MatterScannerBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterScannerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt index 007f332fb..a1dc65a60 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt @@ -20,7 +20,7 @@ import net.minecraft.world.level.material.MaterialColor import net.minecraft.world.phys.BlockHitResult import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity -abstract class BlockMattery @JvmOverloads constructor( +abstract class MatteryBlock @JvmOverloads constructor( properties: Properties = DEFAULT_PROPERTIES ) : Block(properties) { override fun setPlacedBy( @@ -87,7 +87,7 @@ abstract class BlockMattery @JvmOverloads constructor( } } -abstract class BlockMatteryRotatable @JvmOverloads constructor(properties: Properties = DEFAULT_PROPERTIES) : BlockMattery(properties) { +abstract class RotatableMatteryBlock @JvmOverloads constructor(properties: Properties = DEFAULT_PROPERTIES) : MatteryBlock(properties) { init { registerDefaultState(getStateDefinition().any().setValue(facingProperty(), Direction.SOUTH)) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt index d4ed8e878..592b27344 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt @@ -15,7 +15,7 @@ import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.block.entity.PatternStorageBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PatternStorageBlock : BlockMatteryRotatable(), EntityBlock { +class PatternStorageBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { return PatternStorageBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt index 48c1841cb..f2b25cc0f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/PlatePressBlock.kt @@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock { +class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES) : RotatableMatteryBlock(properties), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return PlatePressBlockEntity(p_153215_, p_153216_) } 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 88507ae7c..f552cb152 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 @@ -20,7 +20,7 @@ import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.energy.IEnergyStorage import net.minecraftforge.items.CapabilityItemHandler import ru.dbotthepony.mc.otm.block.BatteryBankBlock -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.capability.* import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.core.ImpreciseFraction @@ -249,7 +249,7 @@ class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte if (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) { if (side == null) return resolverEnergy.cast() - if (side == blockState.getValue(BlockMatteryRotatable.FACING)) + if (side == blockState.getValue(RotatableMatteryBlock.FACING)) return resolverEnergyExtractor.cast() else return resolverEnergyReceive.cast() @@ -268,7 +268,7 @@ class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte fun checkSurroundings(level: Level) { if (isRemoved) return - val tile = level.getBlockEntity(blockPos.offset(blockState.getValue(BlockMatteryRotatable.FACING).normal)) + val tile = level.getBlockEntity(blockPos.offset(blockState.getValue(RotatableMatteryBlock.FACING).normal)) if (tile == null) { outputCapability = LazyOptional.empty() @@ -279,7 +279,7 @@ class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte outputCapability, tile, CapabilityEnergy.ENERGY, - -blockState.getValue(BlockMatteryRotatable.FACING) + -blockState.getValue(RotatableMatteryBlock.FACING) ) { @Suppress("name_shadowing") val level = this.level 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 fe4c3b907..02fab4001 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 @@ -20,7 +20,7 @@ import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.energy.IEnergyStorage import net.minecraftforge.items.CapabilityItemHandler import ru.dbotthepony.mc.otm.* -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.* import ru.dbotthepony.mc.otm.container.MatteryContainer @@ -50,7 +50,7 @@ class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBl } override fun getCapability(cap: Capability, side: Direction?): LazyOptional { - if (valid && (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) && side !== blockState.getValue(BlockMatteryRotatable.FACING)) + if (valid && (cap === MatteryCapability.ENERGY || cap === CapabilityEnergy.ENERGY) && side !== blockState.getValue(RotatableMatteryBlock.FACING)) return energy.resolver.cast() if (valid && cap === CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) @@ -116,7 +116,7 @@ class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryBl for (direction in Direction.values()) { // нельзя выталкивать энергию через перед - if (direction == blockState.getValue(BlockMatteryRotatable.FACING)) + if (direction == blockState.getValue(RotatableMatteryBlock.FACING)) continue val resolver = level.getBlockEntity(blockPos + direction)?.getEnergySided(-direction) 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 57095b172..596ea9975 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 @@ -11,7 +11,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.AABB import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizer import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizerLens -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.core.plus @@ -27,7 +27,7 @@ class GravitationStabilizerBlockEntity(p_155229_: BlockPos, p_155230_: BlockStat fun tick(level: Level) { var findBlackHole: BlackHoleBlockEntity? = null - val dir = blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal + val dir = blockState.getValue(RotatableMatteryBlock.FACING_FULL).normal for (i in 2 .. RANGE) { val pos = blockPos + dir * i diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt index a9d66cbe2..dfd0764ed 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt @@ -12,7 +12,7 @@ import net.minecraft.client.renderer.texture.OverlayTexture import net.minecraft.core.Direction import net.minecraft.network.chat.TranslatableComponent import ru.dbotthepony.mc.otm.block.BlackHoleBlock -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState @@ -37,7 +37,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv var len = 64.0 var lenI = 64 - val normal = tile.blockState.getValue(BlockMatteryRotatable.FACING_FULL).normal + val normal = tile.blockState.getValue(RotatableMatteryBlock.FACING_FULL).normal val level = tile.level var bhTile: BlackHoleBlockEntity? = null @@ -58,7 +58,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv poseStack.pushPose() poseStack.translate(0.5, 0.5, 0.5) - val facing: Direction = tile.blockState.getValue(BlockMatteryRotatable.FACING_FULL) + val facing: Direction = tile.blockState.getValue(RotatableMatteryBlock.FACING_FULL) val rotateZ: Double val rotateY: Double