1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Encoded version arithmetic, ported from
//! `DataConverterJava/.../converters/DataConverter.java:39-53`.
//!
//! A "version" in the engine is a single 64-bit value packing the integer data
//! version in the high 32 bits and a sub-step in the low 32 bits, so that
//! `encode(v, step) < encode(v, step+1) < encode(v+1, 0)` — a total order over
//! (version, step). The walk in [`crate::dataconverter::engine`] iterates this
//! order ascending (forward) or descending (reverse).
/// An encoded (version, step) pair. High 32 bits = data version, low 32 = step.
pub type EncodedVersion = u64;
/// `encodeVersions(version, step)` — DataConverter.java:39-41.
pub const
/// Decode the data version (high 32 bits) — DataConverter.java:43-45.
pub const
/// Decode the sub-step (low 32 bits) — DataConverter.java:47-49.
pub const
/// Human-readable `version.step` — DataConverter.java:51-53.
/// The step value used for the endpoints of a top-level conversion request:
/// `Integer.MAX_VALUE`, so the source endpoint sits past every sub-step of its
/// version and the target endpoint includes every sub-step of the target
/// (MCDataConverter.java:43-49).
pub const MAX_STEP: i32 = i32MAX;
/// `V99.VERSION` — the legacy/pre-converter sentinel. Data with no `DataVersion`
/// tag (1.7.10 and earlier) is clamped up to this before conversion
/// (MCDataConverter.java:46).
pub const V99: i32 = 99;