update doc/*/scripting/events.md
This commit is contained in:
parent
1a6880a572
commit
b3e5f2a1c0
@ -53,6 +53,15 @@ function on_block_tick(x, y, z, tps: number)
|
|||||||
Called tps (20 / tick-interval) times per second for a block.
|
Called tps (20 / tick-interval) times per second for a block.
|
||||||
Use 1/tps instead of `time.delta()`.
|
Use 1/tps instead of `time.delta()`.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
function on_block_present(x, y, z)
|
||||||
|
```
|
||||||
|
|
||||||
|
Called for a specific block when it appears in the world (generated/loaded/placed).
|
||||||
|
The call occurs within a time period that may depend on the event queue load.
|
||||||
|
Under light load, it occurs during the first tick interval of the block.
|
||||||
|
on_block_tick is not called until the event is called.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
function on_player_tick(playerid: int, tps: int)
|
function on_player_tick(playerid: int, tps: int)
|
||||||
```
|
```
|
||||||
|
|||||||
@ -53,6 +53,15 @@ function on_block_tick(x, y, z, tps: number)
|
|||||||
Вызывается tps (20 / tick-interval) раз в секунду для конкретного блока.
|
Вызывается tps (20 / tick-interval) раз в секунду для конкретного блока.
|
||||||
Используйте 1/tps вместо `time.delta()`.
|
Используйте 1/tps вместо `time.delta()`.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
function on_block_present(x, y, z)
|
||||||
|
```
|
||||||
|
|
||||||
|
Вызывается для конкретного блока при появлении (генерации/загрузке/размещении).
|
||||||
|
Вызов происходит в течение времени, которое может зависеть от нагрузки очереди событий.
|
||||||
|
При малой нагрузке происходит в течение первого такта блока (tick-interval).
|
||||||
|
До вызова события on_block_tick не вызывается.
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
function on_player_tick(playerid: int, tps: int)
|
function on_player_tick(playerid: int, tps: int)
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user