diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumDoorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumDoorBlock.kt index 943606243..b4acfd1d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumDoorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumDoorBlock.kt @@ -12,16 +12,15 @@ import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.block.DoorBlock import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.properties.BlockSetType +import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.PushReaction import ru.dbotthepony.mc.otm.core.TranslatableComponent class TritaniumDoorBlock(val color: DyeColor?) : DoorBlock( - Properties.of() - .mapColor(color ?: DyeColor.LIGHT_BLUE) + Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE) .explosionResistance(80f) .noOcclusion() .destroyTime(3f) - .pushReaction(PushReaction.DESTROY) .requiresCorrectToolForDrops(), BlockSetType.IRON ) { @@ -40,6 +39,10 @@ class TritaniumDoorBlock(val color: DyeColor?) : DoorBlock( } } + override fun getPistonPushReaction(p_52814_: BlockState): PushReaction { + return PushReaction.DESTROY + } + override fun canEntityDestroy( state: BlockState, level: BlockGetter, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumTrapdoorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumTrapdoorBlock.kt index 3a1c0de0e..ec0e24043 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumTrapdoorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/TritaniumTrapdoorBlock.kt @@ -13,11 +13,11 @@ import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.block.TrapDoorBlock import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.properties.BlockSetType +import net.minecraft.world.level.material.Material import ru.dbotthepony.mc.otm.core.TranslatableComponent class TritaniumTrapdoorBlock(val color: DyeColor?) : TrapDoorBlock( - Properties.of() - .mapColor(color ?: DyeColor.LIGHT_BLUE) + Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE) .explosionResistance(80f) .noOcclusion().destroyTime(3f) .requiresCorrectToolForDrops() 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 112bf0bc0..9cfea1cc3 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 @@ -9,7 +9,7 @@ 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.MapColor +import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape @@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.needsNoPowerDescription import ru.dbotthepony.mc.otm.shapes.BlockShapes -class CobblerBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f)), EntityBlock { +class CobblerBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f)), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return CobblerBlockEntity(pPos, pState) } @@ -41,6 +41,10 @@ class CobblerBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of() needsNoPowerDescription() } + override fun getPistonPushReaction(p_60584_: BlockState): PushReaction { + return PushReaction.BLOCK + } + private val shapes = getShapeForEachState(rotationProperty) { BlockShapes.COBBLESTONE_GENERATOR.rotateFromNorth(it[rotationProperty]).computeShape() } @Suppress("override_deprecation") 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 e57d06360..e710fb062 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 @@ -12,7 +12,7 @@ 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.MapColor +import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.shapes.CollisionContext @@ -25,7 +25,7 @@ import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.shapes.BlockShapes -class EssenceStorageBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(60.0f)), EntityBlock { +class EssenceStorageBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(60.0f)), EntityBlock { override fun newBlockEntity(pPos: BlockPos, pState: BlockState): BlockEntity { return EssenceStorageBlockEntity(pPos, pState) } @@ -51,6 +51,10 @@ class EssenceStorageBlock(val color: DyeColor?) : RotatableMatteryBlock(Properti addSimpleDescription() } + override fun getPistonPushReaction(p_60584_: BlockState): PushReaction { + return PushReaction.BLOCK + } + private val shapes = getShapeForEachState(rotationProperty) { BlockShapes.ESSENCE_STORAGE.rotateFromNorth(it[rotationProperty]).computeShape() } @Suppress("override_deprecation") 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 8bafde210..69c6b7ef3 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 @@ -14,7 +14,7 @@ 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.block.state.StateDefinition -import net.minecraft.world.level.material.MapColor +import net.minecraft.world.level.material.Material import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape @@ -26,7 +26,7 @@ import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.shapes.BlockShapes -class PlatePressBlock(val color: DyeColor?, val isTwin: Boolean = false) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).pushReaction(PushReaction.BLOCK).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f)), EntityBlock { +class PlatePressBlock(val color: DyeColor?, val isTwin: Boolean = false) : RotatableMatteryBlock(Properties.of(Material.METAL, color ?: DyeColor.LIGHT_BLUE).requiresCorrectToolForDrops().destroyTime(1.5f).explosionResistance(25.0f)), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { return PlatePressBlockEntity(p_153215_, p_153216_, isTwin) } @@ -47,6 +47,10 @@ class PlatePressBlock(val color: DyeColor?, val isTwin: Boolean = false) : Rotat builder.add(WorkerState.WORKER_STATE) } + override fun getPistonPushReaction(p_60584_: BlockState): PushReaction { + return PushReaction.BLOCK + } + override fun appendHoverText( itemStack: ItemStack, blockAccessor: BlockGetter?, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index 31bf0cea3..ffa52fdff 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -146,8 +146,7 @@ object MRegistry : IBlockItemRegistryAcceptor { }.also { decorativeBlocks.add(it) } val COMPUTER_TERMINAL = DecorativeBlock.rotatable("computer_terminal", BlockShapes.COMPUTER_TERMINAL, BlockRotationFreedom.HORIZONTAL) { - BlockBehaviour.Properties.of() - .mapColor(it?.mapColor ?: MapColor.COLOR_LIGHT_BLUE) + BlockBehaviour.Properties.of(Material.METAL, it ?: DyeColor.LIGHT_BLUE) .sound(SoundType.METAL) .explosionResistance(15f) .destroyTime(1.5f)