Skip to main content

Module celestial

Module celestial 

Source
Expand description

The clock, read from the pinned game (spec-0081): the moon’s eight phases, the sun’s eased path, the sky-light and monster-burn keyframes, and the twelve ticks a body’s position names.

The game’s clock is one number, dayTime. time set writes it absolutely; time query daytime reads it modulo 24000 and time query day divided by it; the moon’s phase is that quotient modulo 8. Clock is that number split the way the two read-backs split it.

§One authority

data/timeline-day-1.21.11.json and data/timeline-moon-1.21.11.json are data/minecraft/timeline/day.json and moon.json of the pinned server jar, byte for byte plus one trailing newline (tools/maintenance/extract-timelines.py checks them against the jar; provenance in crates/delvec/data/PROVENANCE.md). Every value below that the game owns is read from them and from nothing typed here: the phase names and their order, the sun_angle keyframes and their cubic-bezier ease, the sky_light_level ramp and the monsters_burn window.

§The position table is derived, then frozen

position_tick is twelve integer constants, because the emission path carries no trigonometry (ADR-0006). the_position_table_is_the_curve re-derives every one from the vendored track, the client’s two sky-quad constants and the disc fraction of the celestial textures, and fails when a constant differs from its derivation by a tick.

Structs§

CelestialTime
A sky stated in a designer’s words: one body, where it stands, and — where the moon shows — its phase (spec-0081 §3.1). Exactly one of sun and moon (DW0931).
Clock
The clock one time value sets: dayTime split the way the game’s two read-backs split it. Two time values are equal when their clocks are.
MoonPhase
One of the moon’s eight phases, held as its index (0 = full-moon, the phase of day 0). Written in a document as the pinned game’s own name, kebab-cased; the names are DATA, read from the vendored moon.json, never an enum this engine authors (spec-0039: vanilla registry values are data).

Enums§

Body
A body in the sky: the sun or the moon. The moon stands exactly opposite the sun (moon_angle is sun_angle + 180), so the two are one position seen from two sides.
CelestialSite
Where a celestial time is written, for the rules of its shape (DW0931).
Position
Where a body stands on its arc — one point of it, defined by the body’s drawn disc and the horizon (spec-0081 §3.2).

Constants§

DAY_TICKS
Ticks in one day: time query daytime is dayTime modulo this.
MOON_DISC_HALF_CENTIDEG
Half the moon’s drawn disc: atan(20 × 8/32 / 100) = 2.86° (MOON_SIZE 20).
POSITIONS
Every position, in declaration order.
SUN_DISC_HALF_CENTIDEG
Half the angle the sun’s DRAWN disc spans, in hundredths of a degree: atan(30 × 8/32 / 100) = 4.29° — the client’s SUN_SIZE 30 at height 100, of which the texture’s full-brightness disc is 8 of 32 pixels.

Functions§

altitude_of_angle
Altitude in degrees of a body standing angle degrees from the zenith.
day_ease
The ease a track declares, as the file spells it (None = linear).
day_keyframes
A track’s keyframes as (ticks, value), in file order — what a test reads the game’s numbers back through.
degrees_label
An altitude in hundredths of a degree, as a message prints it: +2.86°.
monsters_burn
Whether the gameplay/monsters_burn track of the pinned day timeline is on at a daytime tick (a step track: the value of the last keyframe at or before the tick, wrapping).
monsters_burn_switches
The two ticks the monsters_burn track switches at: (off, on) — 12542 and 23460 in the pinned file.
moon_cycle_days
The moon cycle in days: the number of phase keyframes.
moon_period_ticks
The time_check period over which a predicate reads the phase: the moon timeline’s own period.
moon_up
Whether the moon is at or above the horizon at a daytime tick: from the sun’s setting to its rising, both inclusive (the moon’s centre is on the horizon at those two ticks).
phase_names
The moon’s eight phases, kebab-cased, in the pinned moon.json’s order: index i is the phase of day i modulo 8.
position_altitude_centideg
The named body’s altitude at pos, in hundredths of a degree, by the position’s definition.
position_tick
The daytime tick at which body stands at pos — the integer nearest the pinned track’s solution. Derived once and frozen; the test the_position_table_is_the_curve re-derives every entry.
shape_findings
The rules of one celestial value’s shape (spec-0081 §6), as the message each broken rule earns — empty when the value is well formed. One function, so delvec validate (the world, every cut, every design row) and the camera record’s reader say the same sentence about the same value.
sky_is_dark
Whether the pinned day timeline’s visible sky is dark at a daytime tick: the tick lies on the night plateau of visual/sky_color — between two consecutive keyframes that both carry a value other than the day’s first (ticks 13670..=22330 at the pin, where the sky is multiplied by black). Outside it the sky is lit or in its dusk or dawn ramp. Read off the vendored file, never typed.
sky_light_factor
The gameplay/sky_light_level multiplier of the pinned day timeline at a daytime tick: 1.0 on the day plateau, 4/15 on the night plateau, linear ramps between.
sun_altitude_degrees
The sun’s altitude above the horizon, in degrees, at a daytime tick: the body travels a great circle through the zenith, so an angle α from the zenith is an altitude of 90 − α on the western half of the arc and α − 270 on the eastern half. Piecewise linear in the angle — no trigonometry.
sun_angle_degrees
The visual/sun_angle of the pinned day timeline at a daytime tick, in degrees: 0 at noon, growing westward, 180 at midnight. The moon’s angle is this plus 180 (moon_angle is the same track at 540 → 180).
sun_is_west
Whether the sun at this daytime stands on the western half of its arc — past noon and before midnight. At noon and midnight exactly the side means nothing and this answers false (east), so a value is a function of the tick alone.