Expand description
Minetest data types used inside of Commands / Packets.
Derive macros MinetestSerialize and MinetestDeserialize are used to produce ser/deser methods for many of the structs below. The order of the fields inside the struct determines the order in which they are serialized/deserialized, so be careful modifying anything below. Their serialized representation must stay the same.
NOTE: The derive macros currently do not work on structs with generic parameters.
TODO(paradust): Having an assert!-like macro that generates Serialize/Deserialize errors instead of aborts may be helpful for cleaning this up.
Structs§
- AOCAttach
To - AOCObsolete1
- AOCPunched
- AOCSet
Animation - AOCSet
Animation Speed - AOCSet
Bone Position - AOCSet
Physics Override - AOCSet
Properties - AOCSet
Sprite - AOCSet
Texture Mod - AOCSpawn
Infant - AOCUpdate
Armor Groups - AOCUpdate
Position - AbsBlock
Pos - AbsNode
Metadata List - Active
Object Message - AddParticle
Spawner Extra - AddParticle
Spawner Legacy - This is the way ADD_PARTICLESPAWNER is serialized. It seems to be an older version of ParticleParameters
- Added
Object - Array0
- An array of items with no specified length. The length is determined by buffer end.
- Array8
- An array of items with a u8 length prefix
- Array16
- An array of items with a u16 length prefix
- Array32
- An array of items with a u32 length prefix
- Auth
Mechs Bitset - Auto
Exposure - Binary
Data16 - Binary
Data32 - Binary data preceded by a U32 size
- Block
Pos - BlockPos addresses a node within a block It is equivalent to (16*z + y)*16 + x, where x,y,z are from 0 to 15.
- Byte
String - Rust String’s must be valid UTF8. But Minetest’s strings can contain arbitrary
binary data. The only way to store arbitrary bytes is with something like Vec
, which is not String-like. This provides a String-like alternative, that looks nice in debug output. - Content
Features - Fixed
Array - Generic
Init Data - This corresponds to GenericCAO::Initialize in minetest
- HudFlags
- Inventory
- Inventory
List - Item
Alias - ItemDef
- Item
Stack - Item
Stack Metadata - Itemdef
List - Lighting
- Line
Attractor - Long
String - MapBlock
- MapNode
- The default serialization is used for single nodes. But for transferring entire blocks, MapNodeBulk is used instead.
- MapNodes
Bulk - This has a special serialization, presumably to make it compress better. Each param is stored in a separate array.
- Media
Announcement - Media
File Data - Minimap
Mode - Minimap
Mode List - Moon
Params - Node
BoxConnected - Node
BoxFixed - Node
BoxLeveled - Node
BoxWallmounted - Node
DefManager - Node
Metadata - Node
Metadata List - Object
Properties - Pair
- Particle
Parameters - This is the send format used by SendSpawnParticle See ParticleParameters::serialize
- Plane
Attractor - Player
Pos - Point
Attractor - Protocol
Context - Ranged
Parameter - Ranged
Parameter Legacy - SColor
- Server
Particle Texture - Server
Particle Texture NewProps Only - Simple
Sound Spec - SkyColor
- Skybox
Params - Star
Params - String
Var - SunParams
- TileDef
- Tool
Capabilities - Tool
Group Cap - Tweened
Parameter - WString
- Corresponds to std::wstring in C++ land
- Wrapped16
- Wrapped32
- ZLib
Compressed - ZStd
Compressed - aabb3f
- v2f
- v2s16
- v2s32
- v2u32
- v3f
- v3s16
- v3s32
Enums§
- Access
Denied Code - Active
Object Command - Align
Style - Alpha
Mode - Attractor
- Blend
Mode - This is serialized as part of a combined ‘flags’ field on ServerParticleTexture, so it doesn’t implement the methods on its own.
- Command
Direction - Draw
Type - HudSet
Param - HudStat
- Interact
Action - Inventory
Action - Inventory
Entry - Inventory
Location - Item
Stack Update - Item
Type - NodeBox
- Option16
- Pointed
Thing - Skybox
Data - Tile
Animation Params - Tween
Style