mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
update console commands execution pipeline
This commit is contained in:
parent
a0210c82ce
commit
db2795eb4f
3 changed files with 26 additions and 7 deletions
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
To work with the command interpreter, use the **console** library.
|
||||
|
||||
When sending a command via the standard console (core:console layout):
|
||||
1. the `allow-cheats` rule is checked
|
||||
2. the `pos.x|y|z`, `entity.id`, `entity.selected` variables are automatically set.
|
||||
3. the command handler is called - console.submit or the default one.
|
||||
|
||||
The default handler calls console.execute, passing the result to the console.log call.
|
||||
|
||||
## Commands creation
|
||||
|
||||
To create a console command, use the following function:
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
|
||||
Для работы с командным интерпретатором предоставляется библиотека **console**.
|
||||
|
||||
При отправке команды через стандартную консоль (макет core:console):
|
||||
1. проверяется правило `allow-cheats`
|
||||
2. автоматически устанавливаются переменные `pos.x|y|z`, `entity.id`, `entity.selected`.
|
||||
3. вызывается обработчик команд - console.submit или по-умолчанию.
|
||||
|
||||
Обработчик по-умолчанию вызывает console.execute, передавая результат в вызов console.log.
|
||||
|
||||
## Создание команд
|
||||
|
||||
Для создания команды консоли используется следующая функция:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue