pretty lomp.

This commit is contained in:
DBotThePony 2023-03-11 01:15:10 +07:00
parent e8d76a4a8e
commit 0ea4669d49
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,7 @@ class LaboratoryLamp(val invertRedstone: Boolean) : Block(Properties.of(Material
override fun getStateForPlacement(context: BlockPlaceContext): BlockState {
return super.getStateForPlacement(context)!!
.setValue(BlockStateProperties.LIT, !invertRedstone)
.setValue(FACING_FULL, -context.nearestLookingDirection.blockRotation)
.setValue(FACING_FULL, context.nearestLookingDirection.blockRotation.oppositeFront)
}
override fun appendHoverText(

View File

@ -155,6 +155,8 @@ enum class BlockRotation(
val opposite by lazy { of(front.opposite, top.opposite) }
val normal: Vec3i get() = front.normal
val oppositeFront by lazy { of(front.opposite, top) }
companion object {
@JvmStatic
fun of(direction: Direction): BlockRotation {