Make lab lamps face the player when placed

This commit is contained in:
DBotThePony 2022-10-10 16:11:45 +07:00
parent c563a301dc
commit cb9454dadb
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

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