From 23682cfd5aa4e13320a6b1404e02c11fc921e6c3 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 20 Mar 2024 10:18:08 +0300 Subject: [PATCH] docs: block.get_rotation, block.set_rotation --- doc/en/8.Scripting.md | 13 +++++++++++++ doc/ru/8.Скриптинг.md | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/doc/en/8.Scripting.md b/doc/en/8.Scripting.md index 68b1e04b..ace3c80e 100644 --- a/doc/en/8.Scripting.md +++ b/doc/en/8.Scripting.md @@ -213,6 +213,19 @@ block.get_Z(x: int, y: int, z: int) -> int, int, int Returns Z: integer direction vector of the block at specified coordinates. Example: no rotation: 0, 0, 1 + +```python +block.get_rotation(x: int, y: int, z: int) -> int +``` + +Returns block rotation index based on used profile. + +```python +block.set_rotation(x: int, y: int, z: int, rotation: int) +``` + +Set block rotation by index. + ### User bits Part of a voxel data used for scripting. Size: 8 bit. diff --git a/doc/ru/8.Скриптинг.md b/doc/ru/8.Скриптинг.md index 7d174252..40b0a5a3 100644 --- a/doc/ru/8.Скриптинг.md +++ b/doc/ru/8.Скриптинг.md @@ -208,6 +208,18 @@ block.get_Z(x: int, y: int, z: int) -> int, int, int Возвращает целочисленный единичный вектор Z блока на указанных координатах с учётом его вращения (три целых числа). Если поворот отсутствует, возвращает 0, 0, 1 +```python +block.get_rotation(x: int, y: int, z: int) -> int +``` + +Возвращает индекс поворота блока в его профиле вращения. + +```python +block.set_rotation(x: int, y: int, z: int, rotation: int) +``` + +Устанавливает вращение блока по индексу в его профиле вращения. + ### Пользовательские биты Выделенная под использования в скриптах часть поля `voxel.states` хранящего доп-информацию о вокселе, такую как вращение блока. На данный момент выделенная часть составляет 8 бит.