Zig: Registries
Functions
registry.blocks
| Zig |
|---|
| pub fn blocks(allocator: Allocator) core.Error!types.Owned(BlockType)
|
Every block type.
- Parameters:
- Return type:
core.Error!types.Owned(BlockType)
- Slots:
registry_list
registry.items
| Zig |
|---|
| pub fn items(allocator: Allocator) core.Error!types.Owned(ItemType)
|
Every item, each once under its own full name.
- Parameters:
- Return type:
core.Error!types.Owned(ItemType)
- Slots:
registry_list
registry.entities
| Zig |
|---|
| pub fn entities(allocator: Allocator) core.Error!types.Owned(EntityType)
|
Every entity the level knows.
- Parameters:
- Return type:
core.Error!types.Owned(EntityType)
- Slots:
registry_list
registry.commands
| Zig |
|---|
| pub fn commands(allocator: Allocator) core.Error!types.Owned(CommandType)
|
Every command the engine's registry holds, whichever mod registered it.
- Parameters:
- Return type:
core.Error!types.Owned(CommandType)
- Slots:
registry_list
Declarations
registry.EntityType.json_keys
| Zig |
|---|
| pub const json_keys = .{ .type_id = "type" };
|
registry.EntityType
| Zig |
|---|
| pub const EntityType = struct {
name: []const u8 = "",
spawn_egg: bool = false,
summonable: bool = false,
experimental: bool = false,
type_id: i64 = 0,
// ...
};
|
One entity the level knows.
registry.EntityType.isMob
| Zig |
|---|
| pub fn isMob(self: EntityType) bool
|
registry.EntityType.isMonster
| Zig |
|---|
| pub fn isMonster(self: EntityType) bool
|
registry.EntityType.isAnimal
| Zig |
|---|
| pub fn isAnimal(self: EntityType) bool
|
A land animal: the animal bit without the water-animal one.
registry.EntityType.isWaterAnimal
| Zig |
|---|
| pub fn isWaterAnimal(self: EntityType) bool
|
registry.BlockType
| Zig |
|---|
| pub const BlockType = struct {
name: []const u8 = "",
category: i32 = 0,
solid: bool = false,
vanilla: bool = false,
container: bool = false,
signal: bool = false,
fence: bool = false,
rail: bool = false,
slab: bool = false,
wall: bool = false,
crop: bool = false,
entity: bool = false,
destroy: f64 = 0,
resistance: f64 = 0,
light: i32 = 0,
description: []const u8 = "",
// ...
};
|
One block type, read from its default state.
registry.ItemType
| Zig |
|---|
| pub const ItemType = struct {
name: []const u8 = "",
rarity: i32 = 0,
stack: i32 = 0,
category: i32 = 0,
hidden: bool = false,
// ...
};
|
One item.
registry.CommandType
| Zig |
|---|
| pub const CommandType = struct {
name: []const u8 = "",
description: []const u8 = "",
permission: i32 = 0,
flags: i32 = 0,
hidden: bool = false,
aliases: []const []const u8 = &.{},
// ...
};
|
One command the engine's registry holds.