From a178c88bf295c055a70ef8afc80738a7391a1602 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 27 Oct 2022 18:50:48 +0700 Subject: [PATCH] =?UTF-8?q?GearShocky=20=E2=80=94=20=D0=A1=D0=B5=D0=B3?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D1=8F,=20=D0=B2=2018:47=20pattern=20monitor?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BF=D0=BE=D0=B2=D0=BE=D1=80=D0=B0=D1=87?= =?UTF-8?q?=D0=B8=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/block/matter/MatterPanelBlock.kt | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) 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 22c6d373f..d23b5bcd5 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 @@ -16,8 +16,9 @@ import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.properties.EnumProperty import ru.dbotthepony.mc.otm.block.MatteryBlock +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock -class MatterPanelBlock : MatteryBlock(), EntityBlock { +class MatterPanelBlock : RotatableMatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { return MatterPanelBlockEntity(blockPos, blockState) } @@ -25,10 +26,10 @@ class MatterPanelBlock : MatteryBlock(), EntityBlock { private val shapes: ImmutableMap init { - registerDefaultState(getStateDefinition().any().setValue(FACING, Direction.SOUTH)) + registerDefaultState(getStateDefinition().any().setValue(FACING_FULL, Direction.SOUTH)) shapes = getShapeForEachState { - when (it.getValue(FACING)) { + when (it.getValue(FACING_FULL)) { Direction.NORTH -> Shapes.box( 0.0, 0.0, @@ -90,15 +91,10 @@ class MatterPanelBlock : MatteryBlock(), EntityBlock { return shapes[p_60555_]!! } - override fun createBlockStateDefinition(builder: StateDefinition.Builder) { - builder.add(FACING) - } + override val hasFreeRotation: Boolean + get() = true override fun getStateForPlacement(context: BlockPlaceContext): BlockState? { - return defaultBlockState().setValue(FACING, context.clickedFace) + return defaultBlockState().setValue(FACING_FULL, context.clickedFace) } - - companion object { - val FACING: EnumProperty = EnumProperty.create("facing", Direction::class.java) - } -} \ No newline at end of file +}