move default block material name to defaults.toml

This commit is contained in:
MihailRis 2026-07-28 23:18:41 +03:00
parent 8a40bf4fcd
commit 383dcde2e7
3 changed files with 5 additions and 3 deletions

View file

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

View file

@ -39,6 +39,9 @@ std::unique_ptr<Content> ContentBuilder::build() {
} else {
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;
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 std::string DEFAULT_MATERIAL = "base:stone";
struct BlockFuncsSet {
bool init : 1;
bool update : 1;
@ -206,7 +204,7 @@ public:
dv::value properties = nullptr;
/// @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
/// clouds)