Merge branch 'main' into animation

This commit is contained in:
MihailRis 2026-08-04 23:39:49 +03:00
commit 282c9b3de2
68 changed files with 1419 additions and 488 deletions

View file

@ -180,14 +180,34 @@ app.get_content_sources() -> table<string>
Returns a list of content sources (paths), in descending priority order.
``lua
```lua
app.set_content_sources(sources: table<string>)
```
Sets a list of content sources (paths). Specified in descending priority order.
``lua
```lua
app.reset_content_sources()
```
Resets content sources.
## Sub-instances
```lua
-- Creates a headless engine instance with the current project and the specified application script.
-- Returns the instance ID. The number of active sub-instances is currently limited to one.
app.start_background_instance(
-- script file
app_script: string,
-- log file
output_file: string | nil
) -> int
-- Checks if the engine sub-instance is alive.
app.is_instance_alive(handle: int) -> boolean
-- Stops the engine sub-instance.
-- Returns true if the instance was alive at the time of the call.
app.terminate(handle: int) -> boolean
```

View file

@ -28,7 +28,8 @@ block.get(x: int, y: int, z: int) -> int
block.get_states(x: int, y: int, z: int) -> int
-- Set block with given integer ID and state (default - 0) at given position.
block.set(x: int, y: int, z: int, id: int, states: int)
-- If noupdate=true is passed, the `on_update` event will not be called for adjacent blocks.
block.set(x: int, y: int, z: int, id: int, states: int, noupdate: boolean=false)
-- Places a block with a given integer id and state (default - 0) at given position.
-- on behalf of the player, calling the on_placed event.

View file

@ -0,0 +1,28 @@
# *ctypes* Library
A library for safe work with C types.
| ctypes.\<name\> | C-Type | Minimum | Maximum |
| --------------- | -------- | -------------------- | -------------------- |
| uint8 | uint8_t | 0 | 255 |
| uint16 | uint16_t | 0 | 65535 |
| uint32 | uint32_t | 0 | 4294967295 |
| uint64 | uint64_t | 0 | 18446744073709551615 |
| int8 | int8_t | -128 | 127 |
| int16 | int16_t | -32768 | 32767 |
| int32 | int32_t | -2147483648 | 2147483647 |
| int64 | int64_t | -9223372036854775808 | 9223372036854775807 |
Usage examples:
```lua
local x = ctypes.uint64(1234)
print(x) --> 1234ULL (cdata)
local y = ctypes.uint64("18446744073709551615")
print(y) --> 18446744073709551615ULL (cdata)
print(x + y) --> 1233ULL
local z = tonumber(x)
print(z) --> 1234 (number)
```