3 #[mt_derive(to = "clt")]
11 #[mt_derive(to = "clt", repr = "u8")]
21 #[mt_derive(to = "clt", repr = "u32", enumset)]
28 #[mt_derive(to = "clt", repr = "u64", enumset)]
29 pub enum CsmRestrictionFlag {
38 #[mt_derive(to = "clt", repr = "u8")]
39 pub enum ChatMsgType {
46 #[mt_derive(to = "clt", repr = "u8")]
47 pub enum PlayerListUpdateType {
69 #[mt_derive(to = "clt", repr = "u16", tag = "type", content = "data")]
72 serialize_version: u8,
73 #[mt(const_before = "0u16")] // compression
75 auth_methods: EnumSet<AuthMethod>,
79 #[mt(multiplier = "BS")]
80 #[mt(map_ser = "|x| Ok(x + Vector3::new(0.0, 0.5, 0.0) * BS)")]
81 #[mt(map_des = "|x: Point3<f32>| Ok(x - Vector3::new(0.0, 0.5, 0.0) * BS)")]
82 player_pos: Point3<f32>,
85 sudo_auth_methods: EnumSet<AuthMethod>,
88 #[mt(const_after = "[0u8; 15]")]
89 sudo_auth_methods: EnumSet<AuthMethod>,
92 Kick(KickReason) = 10,
116 CsmRestrictionFlags {
117 flags: EnumSet<CsmRestrictionFlag>,
121 #[mt(multiplier = "BS")]
131 #[mt(const_before = "1u8")]
132 msg_type: ChatMsgType,
137 timestamp: i64, // unix time
153 #[mt(multiplier = "BS")]
165 transition_time: f32,
169 #[mt(multiplier = "BS")]
170 point_at: Point3<f32>,
175 #[mt(len = "(u32, (DefCfg, u32))")]
176 files: HashMap<String, Vec<u8>>, // name -> payload
178 #[mt(size = "u32", zlib)]
179 NodeDefs(#[mt(const_before = "1u8")] NodeDefs) = 58,
181 files: HashMap<String, String>, // name -> base64 sha1 hash
184 #[mt(size = "u32", zlib)]
186 #[mt(const_before = "0u8")] // version
188 aliases: HashMap<String, String>,
195 #[mt(multiplier = "BS")]
198 #[serde(rename = "loop")]
208 privs: HashSet<String>,
244 expiration_time: f32,
251 anim_params: TileAnim,
258 // TODO: support new particlespawner definitions (with tweening)
262 pos: RangeInclusive<Point3<f32>>,
263 vel: RangeInclusive<Vector3<f32>>,
264 acc: RangeInclusive<Vector3<f32>>,
265 expiration_time: RangeInclusive<f32>,
266 size: RangeInclusive<f32>,
273 attached_obj_id: u16,
274 anim_params: TileAnim,
293 flags: EnumSet<HudFlag>,
294 mask: EnumSet<HudFlag>,
296 HotbarParam(HotbarParam) = 77,
300 SkyParams(SkyParams) = 79,
301 OverrideDayNightRatio {
302 #[serde(rename = "override")]
303 ratio_override: bool,
307 idle: RangeInclusive<i32>,
308 walk: RangeInclusive<i32>,
309 dig: RangeInclusive<i32>,
310 walk_dig: RangeInclusive<i32>,
314 #[mt(multiplier = "BS")]
316 #[mt(multiplier = "BS")]
319 RemoveParticleSpawner {
322 CloudParams(CloudParams) = 84,
329 update_type: PlayerListUpdateType,
330 players: HashSet<String>,
342 #[mt(size = "u32", zlib)]
343 #[mt(len = "NodeMetasLen")]
344 changed: HashMap<Vector3<i16>, NodeMeta>,
346 SunParams(SunParams) = 90,
347 MoonParams(MoonParams) = 91,
348 StarParams(StarParams) = 92,
356 MinimapModes(MinimapModesPkt) = 98,
359 impl PktInfo for ToCltPkt {
360 fn pkt_info(&self) -> (u8, bool) {
364 BlockData { .. } | Media { .. } => (2, true),
369 | HotbarParam(_) => (1, true),