#[non_exhaustive]pub struct Config {
pub metadata: bool,
pub equipment: bool,
pub effects: bool,
pub player_list: bool,
pub events: bool,
pub skins: bool,
pub player_names: bool,
pub client_motion: bool,
pub kept_types: &'static [u16],
pub motion_types: &'static [u16],
}Expand description
What the tracker keeps. Everything off costs nothing beyond position tracking; packets for a disabled part are not parsed (and the client should not even decode them, see the version modules’ packet id lists).
#[non_exhaustive]: build it from Config::default with the with_* methods:
let c = ghast_entity::Config::default().with_equipment(false).with_skins(true);
assert!(c.metadata && !c.equipment && c.skins);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.metadata: boolEntity metadata (flags, health, item of item entities, names, …). Default true.
equipment: boolEquipment. Default true.
effects: boolStatus effects. Default true.
player_list: boolTab list (player_info). Default true.
events: boolQueue Events for Entities::drain_events. Default false.
skins: boolKeep the base64 "textures" profile property (skin / cape URLs) of tab-list entries in
PlayerInfo::textures. Default false: properties are skipped without allocating.
player_names: boolWith Config::player_list off: still read the tab list, but keep only each entry’s
profile name and game mode (inline, about 50 bytes per entry; no PlayerInfo). That is
what vanilla needs from it for entities: Entities::player_name (team rules use the
scoreboard name), spectators (not pickable, not pushed, never on the ground) and, on
26.x, refusing a player spawn whose profile is not in the tab list. Ignored when
Config::player_list is on (the full list answers the same questions). Default false.
client_motion: boolThe client view of the other entities: what the vanilla client draws and picks
(Entity::drawn_position, Entity::drawn_bounding_box) and the per-entity clocks
(Entity::position_tick, Entity::spawn_tick, Entity::last_hurt_tick,
Entity::estimated_velocity); the same switch as each tracker’s
track_client_motion. One small heap block per living entity. Default false.
kept_types: &'static [u16]Entity types (minecraft:entity_type registry ids of the tracker’s version) whose
equipment and status effects are kept even with Config::equipment /
Config::effects off: the packets of other types are dropped after their entity id
(one map lookup). Modern (26.x) trackers only; the older ones ignore it. Default empty.
motion_types: &'static [u16]Entity types (minecraft:entity_type registry ids of the tracker’s version) whose client
copy keeps its own motion between the server’s packets (Entities::client_motion):
set by the spawn, set_entity_motion and teleport packets, slowed by 0.98 on each tick
without a running interpolation and cut under 0.003 per axis (LivingEntity.aiStep),
pushed by the local player (Tracker::push_motion of the modern trackers). What a mount carries into the
first tick the bot rides it. Modern (26.x) trackers only. Default empty.
Implementations§
Source§impl Config
impl Config
Sourcepub const fn with_client_motion(self, on: bool) -> Self
pub const fn with_client_motion(self, on: bool) -> Self
Sets Config::client_motion.
Sourcepub const fn with_metadata(self, on: bool) -> Self
pub const fn with_metadata(self, on: bool) -> Self
Sets Config::metadata.
Sourcepub const fn with_equipment(self, on: bool) -> Self
pub const fn with_equipment(self, on: bool) -> Self
Sets Config::equipment.
Sourcepub const fn with_effects(self, on: bool) -> Self
pub const fn with_effects(self, on: bool) -> Self
Sets Config::effects.
Sourcepub const fn with_player_list(self, on: bool) -> Self
pub const fn with_player_list(self, on: bool) -> Self
Sets Config::player_list.
Sourcepub const fn with_events(self, on: bool) -> Self
pub const fn with_events(self, on: bool) -> Self
Sets Config::events.
Sourcepub const fn with_skins(self, on: bool) -> Self
pub const fn with_skins(self, on: bool) -> Self
Sets Config::skins.
Sourcepub const fn with_kept_types(self, types: &'static [u16]) -> Self
pub const fn with_kept_types(self, types: &'static [u16]) -> Self
Sets Config::kept_types.
Sourcepub const fn with_motion_types(self, types: &'static [u16]) -> Self
pub const fn with_motion_types(self, types: &'static [u16]) -> Self
Sets Config::motion_types.
Sourcepub const fn with_player_names(self, on: bool) -> Self
pub const fn with_player_names(self, on: bool) -> Self
Sets Config::player_names.
Sourcepub const fn reads_tab_list(&self) -> bool
pub const fn reads_tab_list(&self) -> bool
true when the tracker reads the tab list (full or names only): its packets
(PLAYER_LIST_IDS of the version module) must reach the tracker.