diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/Cables.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/Cables.kt index 50b6a759a..e5bbdacc5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/Cables.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/Cables.kt @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.shapes.BooleanOp import net.minecraft.world.phys.shapes.CollisionContext @@ -113,7 +114,7 @@ abstract class CableBlock(properties: Properties) : MatteryBlock(properties) { } } -class MatterCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { +class MatterCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().pushReaction(PushReaction.DESTROY).sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { private val shapes = generateShapes(0.15) @Suppress("OVERRIDE_DEPRECATION") @@ -126,7 +127,7 @@ class MatterCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).req } } -class StorageCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { +class StorageCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().pushReaction(PushReaction.DESTROY).sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { private val shapes = generateShapes(0.185) @Suppress("OVERRIDE_DEPRECATION") @@ -139,7 +140,7 @@ class StorageCableBlock : CableBlock(Properties.of().mapColor(MapColor.METAL).re } } -class EnergyCableBlock(val factory: (blockPos: BlockPos, blockState: BlockState) -> BlockEntity) : CableBlock(Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { +class EnergyCableBlock(val factory: (blockPos: BlockPos, blockState: BlockState) -> BlockEntity) : CableBlock(Properties.of().mapColor(MapColor.METAL).pushReaction(PushReaction.DESTROY).requiresCorrectToolForDrops().sound(SoundType.METAL).strength(1.0f, 6.0f)), EntityBlock { private val shapes = generateShapes(0.185) @Suppress("OVERRIDE_DEPRECATION") diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt index 2643ffc89..fb0640659 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/ExplosionDebuggerBlock.kt @@ -9,11 +9,12 @@ 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.PushReaction import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockExplosionDebugger : Block(Properties.of().sound(SoundType.STONE)), EntityBlock { +class BlockExplosionDebugger : Block(Properties.of().sound(SoundType.STONE).pushReaction(PushReaction.BLOCK)), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return BlockEntityExplosionDebugger(p_153215_, p_153216_) } 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 c7806370f..f6d4459d7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatteryBlock.kt @@ -21,6 +21,7 @@ import net.minecraft.world.level.block.EntityBlock import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.properties.Property import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.block.entity.IRedstoneControlled @@ -239,6 +240,7 @@ abstract class MatteryBlock(properties: Properties = DEFAULT_PROPERTIES) : Block companion object { val DEFAULT_PROPERTIES: Properties = Properties.of().mapColor(MapColor.METAL).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f) + val DEFAULT_MACHINE_PROPERTIES: Properties = Properties.of().mapColor(MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/DevChestBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/DevChestBlock.kt index 9e2a1fbd5..3e6c21913 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/DevChestBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/DevChestBlock.kt @@ -4,10 +4,11 @@ import net.minecraft.core.BlockPos import net.minecraft.world.level.block.EntityBlock import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.state.BlockState +import net.minecraft.world.level.material.PushReaction import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.decorative.DevChestBlockEntity -class DevChestBlock : RotatableMatteryBlock(Properties.of().destroyTime(-1f).explosionResistance(360000f)), EntityBlock { +class DevChestBlock : RotatableMatteryBlock(Properties.of().destroyTime(-1f).explosionResistance(360000f).pushReaction(PushReaction.BLOCK)), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return DevChestBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt index d879d13a3..3ff655cdc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/EngineBlock.kt @@ -9,6 +9,7 @@ import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.block.SoundType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock @@ -17,7 +18,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EngineBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_ORANGE).sound(SoundType.METAL).explosionResistance(14f).destroyTime(2.5f).requiresCorrectToolForDrops()) { +class EngineBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_ORANGE).sound(SoundType.METAL).explosionResistance(14f).destroyTime(2.5f).requiresCorrectToolForDrops().pushReaction(PushReaction.NORMAL)) { override fun appendHoverText( p_49816_: ItemStack, p_49817_: BlockGetter?, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/FluidTankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/FluidTankBlock.kt index 6764fc0b4..ea0b5a975 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/FluidTankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/FluidTankBlock.kt @@ -21,7 +21,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class FluidTankBlock : RotatableMatteryBlock(), EntityBlock { +class FluidTankBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return FluidTankBlockEntity(pPos, pState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt index b784c2f1d..d54faef8e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/HoloSignBlock.kt @@ -13,7 +13,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.shapes.BlockShapes -class HoloSignBlock : RotatableMatteryBlock(), EntityBlock { +class HoloSignBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun rotationFreedom(): BlockRotationFreedom { return BlockRotationFreedom.DIRECTIONAL_WITH_ROTATION } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/InfiniteWaterSourceBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/InfiniteWaterSourceBlock.kt index faab35e82..294a0353a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/InfiniteWaterSourceBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/InfiniteWaterSourceBlock.kt @@ -8,10 +8,11 @@ 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.MapColor +import net.minecraft.world.level.material.PushReaction import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.decorative.InfiniteWaterSourceBlockEntity -class InfiniteWaterSourceBlock : RotatableMatteryBlock(Properties.of().destroyTime(1.5f).explosionResistance(10f).requiresCorrectToolForDrops().mapColor(MapColor.WATER)), EntityBlock { +class InfiniteWaterSourceBlock : RotatableMatteryBlock(Properties.of().destroyTime(1.5f).explosionResistance(10f).pushReaction(PushReaction.NORMAL).requiresCorrectToolForDrops().mapColor(MapColor.WATER)), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return InfiniteWaterSourceBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/LaboratoryLamp.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/LaboratoryLamp.kt index 3dc4aa81c..c8d8d6afe 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/LaboratoryLamp.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/LaboratoryLamp.kt @@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.phys.shapes.VoxelShape @@ -28,7 +29,7 @@ import ru.dbotthepony.mc.otm.registry.MBlocks private val FACING_FULL = BlockRotationFreedom.DIRECTIONAL.property -class LaboratoryLampLight : Block(Properties.of().strength(-1.0F, 3600000.8F).noCollission().noLootTable().replaceable().lightLevel { 15 }) { +class LaboratoryLampLight : Block(Properties.of().strength(-1.0F, 3600000.8F).noCollission().noLootTable().replaceable().pushReaction(PushReaction.DESTROY).lightLevel { 15 }) { override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) builder.add(FACING_FULL) @@ -102,7 +103,7 @@ class LaboratoryLampLight : Block(Properties.of().strength(-1.0F, 3600000.8F).no } } -class LaboratoryLamp(val invertRedstone: Boolean) : Block(Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).explosionResistance(12f).destroyTime(2f).requiresCorrectToolForDrops()) { +class LaboratoryLamp(val invertRedstone: Boolean) : Block(Properties.of().mapColor(MapColor.METAL).sound(SoundType.METAL).explosionResistance(12f).destroyTime(2f).requiresCorrectToolForDrops().pushReaction(PushReaction.BLOCK)) { init { registerDefaultState(stateDefinition.any().setValue(BlockStateProperties.LIT, !invertRedstone)) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/PainterBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/PainterBlock.kt index 0e8ffdaa6..c13cce68a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/PainterBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/PainterBlock.kt @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.decorative.PainterBlockEntity -class PainterBlock : RotatableMatteryBlock(), EntityBlock { +class PainterBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return PainterBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt index ad79208e4..7dd4a1876 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt @@ -22,8 +22,8 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterBottlerBlock : RotatableMatteryBlock(), EntityBlock { - override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { +class MatterBottlerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { + override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterBottlerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt index 99ff2d94a..8dd5f1d73 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt @@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterCapacitorBankBlock : RotatableMatteryBlock(), EntityBlock { +class MatterCapacitorBankBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterCapacitorBankBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt index 1393720be..8a3034140 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt @@ -22,9 +22,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -@MethodsReturnNonnullByDefault -@ParametersAreNonnullByDefault -class MatterDecomposerBlock : RotatableMatteryBlock(), EntityBlock { +class MatterDecomposerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterDecomposerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterEntanglerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterEntanglerBlock.kt index 23427703f..96bcf3b1a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterEntanglerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterEntanglerBlock.kt @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.matter.MatterEntanglerBlockEntity -class MatterEntanglerBlock : RotatableMatteryBlock(), EntityBlock { +class MatterEntanglerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterEntanglerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt index 00cc3a746..fbabb31e2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt @@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.math.BlockRotation import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom -class MatterPanelBlock : RotatableMatteryBlock(), EntityBlock { +class MatterPanelBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterPanelBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReconstructorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReconstructorBlock.kt index d46b0e414..3452c1ff2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReconstructorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReconstructorBlock.kt @@ -16,7 +16,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterReconstructorBlock : RotatableMatteryBlock(), EntityBlock { +class MatterReconstructorBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return MatterReconstructorBlockEntity(pPos, pState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt index 1f5078266..13d2bcd0f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterRecyclerBlock : RotatableMatteryBlock(), EntityBlock { +class MatterRecyclerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), 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/matter/MatterReplicatorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt index 1609c8740..a51b83ae5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterReplicatorBlock : RotatableMatteryBlock(), EntityBlock { +class MatterReplicatorBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterReplicatorBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt index 157a81bef..53cc306ca 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class MatterScannerBlock : RotatableMatteryBlock(), EntityBlock { +class MatterScannerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterScannerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt index fc2a84286..d5f36e76a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt @@ -19,8 +19,8 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PatternStorageBlock : RotatableMatteryBlock(), EntityBlock { - override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? { +class PatternStorageBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { + override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return PatternStorageBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt index cd4862293..8f4ecc071 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt @@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class DriveRackBlock : RotatableMatteryBlock(), EntityBlock { +class DriveRackBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return DriveRackBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt index ab4b10c66..03a0bb47c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt @@ -27,7 +27,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class DriveViewerBlock : RotatableMatteryBlock(), EntityBlock { +class DriveViewerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return DriveViewerBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt index 95bdd4d32..32dd33264 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt @@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class ItemMonitorBlock : RotatableMatteryBlock(), EntityBlock { +class ItemMonitorBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return ItemMonitorBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt index 73e66b896..568ec92e9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt @@ -31,7 +31,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.core.math.unaryMinus -class StorageBusBlock : RotatableMatteryBlock(), EntityBlock { +class StorageBusBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun rotationFreedom(): BlockRotationFreedom { return BlockRotationFreedom.DIRECTIONAL } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt index bf45778be..aaef6b7f4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt @@ -32,7 +32,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.core.math.unaryMinus -class StorageImporterBlock : RotatableMatteryBlock(), EntityBlock { +class StorageImporterBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun rotationFreedom(): BlockRotationFreedom { return BlockRotationFreedom.DIRECTIONAL } @@ -105,7 +105,7 @@ class StorageImporterBlock : RotatableMatteryBlock(), EntityBlock { } } -class StorageExporterBlock : RotatableMatteryBlock(), EntityBlock { +class StorageExporterBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun rotationFreedom(): BlockRotationFreedom { return BlockRotationFreedom.DIRECTIONAL } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt index dcef7302a..0f756e32e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt @@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class StoragePowerSupplierBlock : RotatableMatteryBlock(), EntityBlock { +class StoragePowerSupplierBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return StoragePowerSupplierBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/AndroidStationBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/AndroidStationBlock.kt index 722b13328..962af67b5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/AndroidStationBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/AndroidStationBlock.kt @@ -29,7 +29,7 @@ import ru.dbotthepony.mc.otm.core.orNull import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class AndroidStationBlock : MatteryBlock(), EntityBlock { +class AndroidStationBlock : MatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun use( blockState: BlockState, level: Level, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt index 75a288228..c5f7f9c87 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/BatteryBankBlock.kt @@ -27,7 +27,7 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BatteryBankBlock : RotatableMatteryBlock(), EntityBlock { +class BatteryBankBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun getTicker( level: Level, p_153213_: BlockState, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt index 3dd554dbb..3ba037ad4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/ChemicalGeneratorBlock.kt @@ -34,7 +34,7 @@ import ru.dbotthepony.mc.otm.oncePre import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class ChemicalGeneratorBlock : RotatableMatteryBlock(), EntityBlock { +class ChemicalGeneratorBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), 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/tech/CobblerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/CobblerBlock.kt index 8be327fc1..5da695907 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/CobblerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/CobblerBlock.kt @@ -16,7 +16,7 @@ import ru.dbotthepony.mc.otm.block.entity.tech.CobblerBlockEntity import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class CobblerBlock : RotatableMatteryBlock(), EntityBlock { +class CobblerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return CobblerBlockEntity(pPos, pState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt index b6c4a565a..6e0e61f94 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyCounterBlock.kt @@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.once import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EnergyCounterBlock : MatteryBlock(), EntityBlock { +class EnergyCounterBlock : MatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return EnergyCounterBlockEntity(blockPos, blockState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt index b6a0aaa1a..4dff8b68c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EnergyServoBlock.kt @@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EnergyServoBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_BLUE).sound(SoundType.METAL).explosionResistance(12f).destroyTime(2f).requiresCorrectToolForDrops()), EntityBlock { +class EnergyServoBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return EnergyServoBlockEntity(p_153215_, p_153216_) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EssenceStorageBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EssenceStorageBlock.kt index 85b813e2f..41eb4826a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EssenceStorageBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/EssenceStorageBlock.kt @@ -21,7 +21,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EssenceStorageBlock : RotatableMatteryBlock(), EntityBlock { +class EssenceStorageBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return EssenceStorageBlockEntity(pPos, pState) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt index 9e0ff3fe7..ef92bc7f5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PhantomAttractorBlock.kt @@ -21,6 +21,7 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BlockStateProperties import net.minecraft.world.level.block.state.properties.DoubleBlockHalf import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.AABB import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape @@ -34,7 +35,7 @@ import ru.dbotthepony.mc.otm.once import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PhantomAttractorBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_BLUE).sound(SoundType.METAL).destroyTime(3f).explosionResistance(12f).randomTicks()) { +class PhantomAttractorBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_BLUE).sound(SoundType.METAL).pushReaction(PushReaction.BLOCK).destroyTime(3f).explosionResistance(12f).randomTicks()) { @Suppress("OVERRIDE_DEPRECATION") override fun randomTick( blockState: BlockState, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt index 740271336..8aed09a9a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PlatePressBlock.kt @@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PlatePressBlock(properties: Properties = DEFAULT_PROPERTIES, val isTwin: Boolean = false) : RotatableMatteryBlock(properties), EntityBlock { +class PlatePressBlock(properties: Properties = DEFAULT_MACHINE_PROPERTIES, val isTwin: Boolean = false) : RotatableMatteryBlock(properties), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return PlatePressBlockEntity(p_153215_, p_153216_, isTwin) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PoweredFurnaceBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PoweredFurnaceBlock.kt index 1f1be51a0..54eda35b1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PoweredFurnaceBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/tech/PoweredFurnaceBlock.kt @@ -31,7 +31,7 @@ class PoweredFurnaceBlock( val secondaryRecipeType: (() -> RecipeType)?, val config: WorkerBalanceValues, shape: BlockShape? -) : RotatableMatteryBlock(), EntityBlock { +) : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): PoweredFurnaceBlockEntity { return PoweredFurnaceBlockEntity(type.invoke(), p_153215_, p_153216_, recipeType, secondaryRecipeType, config) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt index bb75430c5..a5ea5b8ff 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt @@ -180,7 +180,13 @@ object MBlocks { } val TRITANIUM_BARS: IronBarsBlock by registry.register(MNames.TRITANIUM_BARS) { - IronBarsBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_LIGHT_BLUE).sound(SoundType.METAL).explosionResistance(45f).destroyTime(2.5f).requiresCorrectToolForDrops()) + IronBarsBlock(BlockBehaviour.Properties.of() + .mapColor(MapColor.COLOR_LIGHT_BLUE) + .sound(SoundType.METAL) + .explosionResistance(45f) + .noOcclusion() + .destroyTime(2.5f) + .requiresCorrectToolForDrops()) } val DEEPSLATE_TRITANIUM_ORE: Block by registry.register(MNames.DEEPSLATE_TRITANIUM_ORE) { DropExperienceBlock(