mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
make BlockMaterial serializable
This commit is contained in:
parent
862ac496a8
commit
9e28b783fd
4 changed files with 26 additions and 9 deletions
|
|
@ -186,11 +186,7 @@ void ContentUnitLoader<DefT>::loadUnit(
|
|||
void ContentLoader::loadBlockMaterial(
|
||||
BlockMaterial& def, const io::path& file
|
||||
) {
|
||||
auto root = io::read_json(file);
|
||||
root.at("steps-sound").get(def.stepsSound);
|
||||
root.at("place-sound").get(def.placeSound);
|
||||
root.at("break-sound").get(def.breakSound);
|
||||
root.at("hit-sound").get(def.hitSound);
|
||||
def.deserialize(io::read_json(file));
|
||||
if (def.hitSound.empty()) {
|
||||
def.hitSound = def.stepsSound;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue