Merge pull request #895 from MihailRis/other-suggestions

Other suggestions
This commit is contained in:
MihailRis 2026-07-28 23:49:25 +03:00 • committed by GitHub
commit 8ade2ab5da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 25 additions and 5 deletions

View file

@ -1,6 +1,6 @@
# Block properties # Block properties
## Visual ## Visual & Audio
### *texture* ### *texture*
@ -70,6 +70,18 @@ Rotation profile (set of available block rotations and behaviour of placing bloc
- "pane" - panels, doors, signs - "pane" - panels, doors, signs
- "stairs" - "pane" + flipped variants - "stairs" - "pane" + flipped variants
### *particles*
Particles are specified as a JSON object. Property names can be found [in the particles section](particles.md).
When camera is near to the block, the engine will create an emitter that will run
until the block is destroyed or the camera moves away a certain distance.
### Material - *material*
Defines the name of the block's material in the format `pack:material_name`, which affects the selection of block interaction sounds.
Material definitions are located in /block_materials.
## Variants ## Variants
Some properties can vary dynamically, depending on the variant number stored in the user bits of the block. Some properties can vary dynamically, depending on the variant number stored in the user bits of the block.

View file

@ -1,6 +1,6 @@
# Свойства блоков # Свойства блоков
## Вид ## Вид & Звук
### Текстура - *texture* ### Текстура - *texture*
@ -78,6 +78,11 @@
При приближении к блоку движок создаст эмиттер, который будет работать При приближении к блоку движок создаст эмиттер, который будет работать
до разрушения блока или отдаления камеры на некоторое расстояние. до разрушения блока или отдаления камеры на некоторое расстояние.
### Материал - *material*
Определяет имя материала блока в формате `пак:имя_материала`, что влияет на выбор звуков взаимодействия с блоком.
Определения материалов расположены в /block_materials.
## Варианты ## Варианты
Некоторые свойства могут варьироваться динамически, в зависимости от номера варианта, хранимого в пользовательских битах блока. Некоторые свойства могут варьироваться динамически, в зависимости от номера варианта, хранимого в пользовательских битах блока.

View file

@ -1,3 +1,4 @@
generator = "base:demo" generator = "base:demo"
player-entity = "base:player" player-entity = "base:player"
hand-skeleton = "base:hand" hand-skeleton = "base:hand"
block-material = "base:stone"

View file

@ -3,6 +3,7 @@ function on_open(params)
mode = params.mode mode = params.mode
end end
refresh() refresh()
document.search_textbox.focused = true
end end
-- add - packs to be added to the world (after apply) -- add - packs to be added to the world (after apply)

View file

@ -39,6 +39,9 @@ std::unique_ptr<Content> ContentBuilder::build() {
} else { } else {
def.defaults.rt.solid = isSolid(def.defaults) || def.explictlySolid; def.defaults.rt.solid = isSolid(def.defaults) || def.explictlySolid;
} }
if (def.material.empty()) {
defaults.at("block-material").get(def.material);
}
const float EPSILON = 0.01f; const float EPSILON = 0.01f;
def.rt.solid = def.rt.solid =

View file

@ -37,8 +37,6 @@ inline constexpr size_t MAX_USER_BLOCK_FIELDS_SIZE = 240;
inline constexpr int BLOCK_MAX_VARIANTS = 16; inline constexpr int BLOCK_MAX_VARIANTS = 16;
inline std::string DEFAULT_MATERIAL = "base:stone";
struct BlockFuncsSet { struct BlockFuncsSet {
bool init : 1; bool init : 1;
bool update : 1; bool update : 1;
@ -206,7 +204,7 @@ public:
dv::value properties = nullptr; dv::value properties = nullptr;
/// @brief id of used BlockMaterial, may specify non-existing material /// @brief id of used BlockMaterial, may specify non-existing material
std::string material = DEFAULT_MATERIAL; std::string material;
/// @brief Light emission R, G, B, S (sky lights: sun, moon, radioactive /// @brief Light emission R, G, B, S (sky lights: sun, moon, radioactive
/// clouds) /// clouds)