Module types

Source
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§

AOCAttachTo
AOCObsolete1
AOCPunched
AOCSetAnimation
AOCSetAnimationSpeed
AOCSetBonePosition
AOCSetPhysicsOverride
AOCSetProperties
AOCSetSprite
AOCSetTextureMod
AOCSpawnInfant
AOCUpdateArmorGroups
AOCUpdatePosition
AbsBlockPos
AbsNodeMetadataList
ActiveObjectMessage
AddParticleSpawnerExtra
AddParticleSpawnerLegacy
This is the way ADD_PARTICLESPAWNER is serialized. It seems to be an older version of ParticleParameters
AddedObject
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
AuthMechsBitset
AutoExposure
BinaryData16
BinaryData32
Binary data preceded by a U32 size
BlockPos
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.
ByteString
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.
ContentFeatures
FixedArray
GenericInitData
This corresponds to GenericCAO::Initialize in minetest
HudFlags
Inventory
InventoryList
ItemAlias
ItemDef
ItemStack
ItemStackMetadata
ItemdefList
Lighting
LineAttractor
LongString
MapBlock
MapNode
The default serialization is used for single nodes. But for transferring entire blocks, MapNodeBulk is used instead.
MapNodesBulk
This has a special serialization, presumably to make it compress better. Each param is stored in a separate array.
MediaAnnouncement
MediaFileData
MinimapMode
MinimapModeList
MoonParams
NodeBoxConnected
NodeBoxFixed
NodeBoxLeveled
NodeBoxWallmounted
NodeDefManager
NodeMetadata
NodeMetadataList
ObjectProperties
Pair
ParticleParameters
This is the send format used by SendSpawnParticle See ParticleParameters::serialize
PlaneAttractor
PlayerPos
PointAttractor
ProtocolContext
RangedParameter
RangedParameterLegacy
SColor
ServerParticleTexture
ServerParticleTextureNewPropsOnly
SimpleSoundSpec
SkyColor
SkyboxParams
StarParams
StringVar
SunParams
TileDef
ToolCapabilities
ToolGroupCap
TweenedParameter
WString
Corresponds to std::wstring in C++ land
Wrapped16
Wrapped32
ZLibCompressed
ZStdCompressed
aabb3f
v2f
v2s16
v2s32
v2u32
v3f
v3s16
v3s32

Enums§

AccessDeniedCode
ActiveObjectCommand
AlignStyle
AlphaMode
Attractor
BlendMode
This is serialized as part of a combined ‘flags’ field on ServerParticleTexture, so it doesn’t implement the methods on its own.
CommandDirection
DrawType
HudSetParam
HudStat
InteractAction
InventoryAction
InventoryEntry
InventoryLocation
ItemStackUpdate
ItemType
NodeBox
Option16
PointedThing
SkyboxData
TileAnimationParams
TweenStyle

Type Aliases§

CommandId
s8
s16
s32