Files
horizon-airdef/crates/horizon-core/src/version.rs
T
Ludovic Marie 9f385280ef Version facts in one generated file: crates/horizon-core/src/version.rs
tools/gen_version_consts.py writes what the pinned client jar's version.json
states (name, id, protocol, data version, pack formats, Java, stable, build
time) into horizon_core::version, and every Rust site reads it from there:
PROTOCOL_VERSION, GAME_VERSION, DATA_VERSION, the save's and the datafixer's
version name, /version, the crash report, the legacy ping, the dedicated
server's start line, the title screens, the default resource folder, the
resource pack format, and the launcher's and horizon-ctl's fallbacks. CI
checks the file against the pinned jar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 12:22:20 +02:00

22 lines
1.1 KiB
Rust

//! What Minecraft 26.3 states about itself (the client jar's `version.json`,
//! `SharedConstants.getCurrentVersion()`). Generated by tools/gen_version_consts.py; do not edit by hand.
/// `WorldVersion.id()`.
pub const VERSION_ID: &str = "26.3";
/// `WorldVersion.name()`: level.dat, the server list, crash reports.
pub const VANILLA_VERSION: &str = "26.3";
/// `SharedConstants.getProtocolVersion()`.
pub const PROTOCOL_VERSION: i32 = 777;
/// `WorldVersion.dataVersion()`: the DataVersion of saved chunks, entities and level.dat.
pub const DATA_VERSION: i32 = 5023;
/// `WorldVersion.packVersion(PackType.CLIENT_RESOURCES)`: (major, minor).
pub const RESOURCE_PACK_FORMAT: (i64, i64) = (97, 1);
/// `WorldVersion.packVersion(PackType.SERVER_DATA)`: (major, minor).
pub const DATA_PACK_FORMAT: (i64, i64) = (121, 0);
/// The Java major version the game runs on.
pub const JAVA_VERSION: u32 = 25;
/// `WorldVersion.stable()`: false for snapshots and pre-releases.
pub const STABLE: bool = true;
/// `WorldVersion.buildTime()` as `Date.toString()` prints it in UTC (`/version`).
pub const BUILD_TIME: &str = "Tue Sep 15 11:20:48 UTC 2026";