Merge branch 'main' into dev

This commit is contained in:
MihailRis
2025-11-04 16:02:46 +03:00
12 changed files with 119 additions and 17 deletions
+26
View File
@@ -98,6 +98,32 @@ Properties available for variance:
Variants are managed via `block.set_variant(x, y, z, index)`.
### Custom model variants (geometry switching)
You can use different custom models for different variants. Provide a separate `model-name` for each variant that needs different geometry. The renderer caches geometry per (block id, variant).
The base model (specified in root) becomes variant 0. The variants array maps to indices 1+.
Example (default + two custom variants):
```json
{
"model": "custom",
"model-name": "stairs_middle",
"state-based": {
"bits": 4,
"variants": [
{ "model": "custom", "model-name": "stairs_left" },
{ "model": "custom", "model-name": "stairs_right" }
]
}
}
```
In this example:
- Variant 0 = `stairs_middle` (from root)
- Variant 1 = `stairs_left` (from variants[0])
- Variant 2 = `stairs_right` (from variants[1])
## Lighting
### *emission*
+12
View File
@@ -119,6 +119,18 @@ player.get_name(playerid: int) -> str
Player name setter and getter
```lua
player.get_camera(playerid: int) -> int
```
Returns the index of the player's current camera.
```lua
player.set_camera(playerid: int, camera_index: int)
```
Switches the player's camera. See [cameras](libcameras.md).
```lua
player.set_selected_slot(playerid: int, slotid: int)
```
+6
View File
@@ -190,6 +190,12 @@ function on_hud_open(playerid: int)
Called after world open.
```lua
function on_hud_render()
```
Called every frame. Used for client-side tasks such as animation and camera control.
```lua
function on_hud_close(playerid: int)
```