Zig: Shared types¶
Declarations¶
types.BlockUpdate.neighbors¶
| Zig | |
|---|---|
Notify the neighbors, meaning redstone, liquid flow and block updates.
types.BlockUpdate.network¶
| Zig | |
|---|---|
Synchronize to the client.
types.BlockUpdate.default¶
| Zig | |
|---|---|
Both, equivalent to /setblock.
types.BlockUpdate.none¶
| Zig | |
|---|---|
Neither. For a bulk fill, resynchronizing afterwards.
Functions¶
types.Owned¶
| Zig | |
|---|---|
A list or a record the host produced, whose memory belongs to one arena: deinit frees all of it, every string included.
- Parameters:
- T :
comptime type
- T :
- Return type:
type
types.Bounds¶
A closed box, with both corners included.
types.Bounds.init¶
| Zig | |
|---|---|
The box spanned by two corners given in either order.
- Parameters:
- a :
Pos3 - b :
Pos3
- a :
- Return type:
Bounds
types.Bounds.size¶
| Zig | |
|---|---|
The number of cells along each axis.
- Return type:
[3]u64
types.Bounds.volume¶
| Zig | |
|---|---|
The number of cells in the box.
- Return type:
u64
types.Bounds.contains¶
| Zig | |
|---|---|
Whether the cell is inside the box.
- Parameters:
- p :
Pos3
- p :
- Return type:
bool
types.RayHit¶
| Zig | |
|---|---|
The result of one ray trace, from actor_trace_ray or edit_trace_ray.
types.RayHit.blockPos¶
| Zig | |
|---|---|
The cell of a block hit.
- Return type:
?Pos3
types.RayHit.entityId¶
| Zig | |
|---|---|
The id of an actor hit.
- Return type:
?i64
types.RayHit.deinit¶
| Zig | |
|---|---|
Frees the block name, which belongs to the allocator the trace was given.
- Parameters:
- allocator :
std.mem.Allocator
- allocator :
- Return type:
void
types.GameMode¶
| Zig | |
|---|---|
The game mode. The values are part of the ABI, through player_set_gamemode.
Note that spectator is 6 and not 3: the values in between mean other things in the engine, and guessing one from the order sets the player to a different mode.
types.GameMode.fromInt¶
| Zig | |
|---|---|
- Parameters:
- v :
i32
- v :
- Return type:
?GameMode
types.PlayerPermission¶
| Zig | |
|---|---|
The player permission level, through PIER_PACT_SET_PERMISSION_LEVEL and PIER_PPROP_PERMISSION_LEVEL.
types.PlayerPermission.fromInt¶
| Zig | |
|---|---|
- Parameters:
- v :
i32
- v :
- Return type:
?PlayerPermission
types.Weather¶
The weather. The three states of set_weather.
types.Weather.fromInt¶
| Zig | |
|---|---|
- Parameters:
- v :
i32
- v :
- Return type:
?Weather
types.Difficulty¶
The difficulty.
types.Difficulty.fromInt¶
| Zig | |
|---|---|
- Parameters:
- v :
i32
- v :
- Return type:
?Difficulty
types.TitleKind¶
| Zig | |
|---|---|
The SetTitlePacketPayload::TitleType of player_send_title.
types.TitleKind.usesText¶
| Zig | |
|---|---|
Whether this kind carries text.
- Return type:
bool
types.EquipSlot¶
| Zig | |
|---|---|
An equipment slot. The numbering actor_get_equipped_item and player_get_equipment use.
types.EquipSlot.fromInt¶
| Zig | |
|---|---|
- Parameters:
- v :
i32
- v :
- Return type:
?EquipSlot
types.Ability¶
A player ability bit. The index of PIER_PACT_SET_ABILITY and PIER_PACT_CAN_USE_ABILITY.
The three carrying speed are floating-point abilities and the rest are boolean.
types.Ability.isFloat¶
| Zig | |
|---|---|
Whether the ability holds a number and not a flag.
- Return type:
bool
types.Pos3¶
A block coordinate.
types.Vec3¶
An actor or exact coordinate.
types.MessageType¶
| Zig | |
|---|---|
The TextPacketType of player_send_message_typed.
The host falls back to raw on an out-of-range value, so no fallback branch is needed here.
types.TitleTimes¶
| Zig | |
|---|---|
The three title durations, in ticks.
All three are given together or not at all: the host refuses a half-specified combination rather than guessing the rest for the caller.
types.BlockUpdate¶
Tells the engine which follow-up work a block write needs.
types.LocalTime¶
| Zig | |
|---|---|
The local time, from PIER_SYS_LOCAL_TIME.
types.AttributeValue¶
| Zig | |
|---|---|
One attribute of an entity as Entity.attributeInfo reads it.
types.Aabb¶
The axis-aligned bounding box of an actor.
types.Effect¶
| Zig | |
|---|---|
One status effect.
types.Enchant¶
One enchantment.
types.NetworkStatus¶
| Zig | |
|---|---|
The network status of a player, from PIER_PSTR_NETWORK_STATUS. A value the host could not measure is -1.
types.EquipmentEntry¶
One slot of a player's equipment.
types.PlayerPosition¶
A player's feet position and the dimension it is in.
types.ItemOp¶
| Zig | |
|---|---|
The operations of Item.transform, the numbering of item_transform.