ghast-physics 0.5.1

Vanilla-exact, pure and deterministic player movement for the ghast Minecraft Java Edition client library (1.8.9, 1.12.2, 1.16.5, 26.1, 26.2 and 26.3), verified bit for bit against the real game
Documentation
//! The 26.3 `isFaceSturdy(DOWN)` facts (`state_flags::STURDY_DOWN`) against the oracle dump.

#[cfg(all(test, feature = "v26_3"))]
mod tests {
    use std::io::Read;

    /// The table equals the dump, state by state (ids and names checked against the data set).
    #[test]
    fn sturdy_down_matches_oracle_dump() {
        let path = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
            .join("../../tests/golden/26.3/voxel_shapes.jsonl.gz");
        let mut text = String::new();
        flate2::read::GzDecoder::new(std::fs::File::open(path).expect("golden"))
            .read_to_string(&mut text)
            .expect("gzip");
        let mut n = 0;
        for l in text.lines() {
            let v: serde_json::Value = serde_json::from_str(l).unwrap();
            if v["type"] != "state" {
                continue;
            }
            let id = v["id"].as_u64().unwrap() as u16;
            let s = ghast_data::v26_3::BlockState::from_id(id).unwrap();
            assert_eq!(s.to_string(), v["state"].as_str().unwrap());
            let want = v["side_solid_down"].as_bool().unwrap();
            assert_eq!(
                <super::super::V26_3 as super::super::Rules>::sturdy_down(s),
                want,
                "{s}"
            );
            n += 1;
        }
        assert_eq!(n, ghast_data::v26_3::STATE_COUNT);
    }
}