levilamina::registry¶
The engine's own registries: every block type, every item and every entity the running game has, with the facts a rule needs to pick from them.
A mod that hands out "a random block" or "a random rare item" should not keep a list of
names of its own: the game has more than any such list, and the list goes stale with every
version. It reads these instead and decides by rules (solid, not technical, of this rarity).
A host older than the registry_list slot answers with an error, never with an empty list
that would look like a game without content.
Functions¶
registry::blocks¶
| Rust | |
|---|---|
Every block type.
- Return type:
Result<Vec<BlockType>> - Slots:
registry_list
registry::items¶
| Rust | |
|---|---|
Every item, each once under its own full name.
- Return type:
Result<Vec<ItemType>> - Slots:
registry_list
registry::entities¶
| Rust | |
|---|---|
Every entity the level knows.
- Return type:
Result<Vec<EntityType>> - Slots:
registry_list
EntityType¶
One entity the level knows.
- Implements:
Debug,Clone,PartialEq,serde::Deserialize
EntityType::is_mob¶
| Rust | |
|---|---|
- Return type:
bool
EntityType::is_monster¶
| Rust | |
|---|---|
- Return type:
bool
EntityType::is_animal¶
| Rust | |
|---|---|
A land animal: the animal bit without the water-animal one.
- Return type:
bool
EntityType::is_water_animal¶
| Rust | |
|---|---|
- Return type:
bool
BlockType¶
One block type, read from its default state.
- Implements:
Debug,Clone,PartialEq,serde::Deserialize
ItemType¶
One item.
- Implements:
Debug,Clone,PartialEq,serde::Deserialize
Constants¶
| Name | Value | Description |
|---|---|---|
ALL |
0 |
|
CONSTRUCTION |
1 |
|
NATURE |
2 |
|
EQUIPMENT |
3 |
|
ITEMS |
4 |
|
COMMAND_ONLY |
5 |
Reachable by commands only: barriers, command blocks, structure blocks and the like. |
UNDEFINED |
6 |