From 5d7abb6ee8a707edbf7835af62b88bc73d88e8cc Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 12 Oct 2022 10:16:08 +0700 Subject: [PATCH] Add rotate method to lab lamp light --- .../kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt index 14ad15748..c4260a89c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/LaboratoryLamp.kt @@ -12,6 +12,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Blocks import net.minecraft.world.level.block.RenderShape +import net.minecraft.world.level.block.Rotation 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 @@ -48,6 +49,12 @@ class LaboratoryLampLight : Block(Properties.of(Material.AIR).strength(-1.0F, 36 return if (p_60558_.isHoldingItem(Items.LIGHT)) Shapes.block() else Shapes.empty() } + @Suppress("OVERRIDE_DEPRECATION") + override fun rotate(blockState: BlockState, rotation: Rotation): BlockState { + @Suppress("DEPRECATION") + return super.rotate(blockState, rotation).setValue(RotatableMatteryBlock.FACING_FULL, rotation.rotate(blockState[RotatableMatteryBlock.FACING_FULL])) + } + @Suppress("OVERRIDE_DEPRECATION") override fun getRenderShape(p_60550_: BlockState): RenderShape { return RenderShape.INVISIBLE