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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Entity tracking for the ghast Minecraft Java Edition client library (1.8.9, 1.12.2, 1.16.5
//! and 26.1).
//!
//! [`v1_8::Tracker`] / [`v1_12::Tracker`] / [`v1_16_5::Tracker`] / `v26_1::Tracker` take raw
//! clientbound play packets
//! ([`ghast_protocol::RawPacket`]) and keep every entity the server announced, keyed by id:
//! type, UUID, **server position** (exactly as the vanilla client tracks it from the packets,
//! with each version's fixed-point rules), rotation, last velocity, on-ground, riding / leash
//! links, and optionally metadata, equipment, effects and the tab list.
//!
//! - **Cheap.** Packets are parsed by hand straight from the packet body; movement, look,
//! teleport, velocity, head-rotation and destroy packets do not allocate. Lookups are one hash
//! of the id. Parts nobody needs are switched off in [`Config`], and `Tracker::wants(id)` /
//! `packet_ids()` tell the client which packets it can drop before decoding.
//! - **Vanilla semantics.** Spawns replace an existing id, unknown types spawn nothing, moves
//! for unknown ids are ignored, `login` and world changes clear everything, pickups remove
//! the item (1.16: when its stack runs out), riding follows each version's rules.
//! - **Never panics on server data**: malformed bodies return a [`ghast_protocol::DecodeError`].
//!
//! ```
//! use ghast_entity::{Config, v1_8::Tracker};
//! let tracker = Tracker::new(Config::default());
//! assert!(tracker.get(42).is_none());
//! ```
// A build with only some versions leaves helpers of the others unused.
// A build with no version at all keeps only the shared store.
pub use ;
pub use ;
/// What applying a packet did.