mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
move default block material name to defaults.toml
This commit is contained in:
parent
8a40bf4fcd
commit
383dcde2e7
3 changed files with 5 additions and 3 deletions
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 =
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue