From f87bb960a9c5e69ffa28c1fb126c8ddd94a482a2 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 15 Oct 2024 03:22:19 +0300 Subject: [PATCH] replace structures.json with structures.toml --- res/content/base/generators/demo.files/structures.json | 7 ------- res/content/base/generators/demo.files/structures.toml | 5 +++++ src/content/loading/GeneratorLoader.cpp | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 res/content/base/generators/demo.files/structures.json create mode 100644 res/content/base/generators/demo.files/structures.toml diff --git a/res/content/base/generators/demo.files/structures.json b/res/content/base/generators/demo.files/structures.json deleted file mode 100644 index 18f22b26..00000000 --- a/res/content/base/generators/demo.files/structures.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "tree0": {}, - "tree1": {}, - "tree2": {}, - "tower": {}, - "coal_ore0": {} -} diff --git a/res/content/base/generators/demo.files/structures.toml b/res/content/base/generators/demo.files/structures.toml new file mode 100644 index 00000000..3dcf3cda --- /dev/null +++ b/res/content/base/generators/demo.files/structures.toml @@ -0,0 +1,5 @@ +tree0 = {} +tree1 = {} +tree2 = {} +tower = {} +coal_ore0 = {} diff --git a/src/content/loading/GeneratorLoader.cpp b/src/content/loading/GeneratorLoader.cpp index ec8315f5..fcbcebc5 100644 --- a/src/content/loading/GeneratorLoader.cpp +++ b/src/content/loading/GeneratorLoader.cpp @@ -133,7 +133,7 @@ static std::vector> load_structures( const fs::path& structuresFile ) { auto structuresDir = structuresFile.parent_path() / fs::path("fragments"); - auto map = files::read_json(structuresFile); + auto map = files::read_object(structuresFile); std::vector> structures; for (auto& [name, config] : map.asObject()) { @@ -171,7 +171,7 @@ static void load_structures(GeneratorDef& def, const fs::path& structuresFile) { } } -static inline const auto STRUCTURES_FILE = fs::u8path("structures.json"); +static inline const auto STRUCTURES_FILE = fs::u8path("structures.toml"); static inline const auto BIOMES_FILE = fs::u8path("biomes.toml"); static inline const auto GENERATORS_DIR = fs::u8path("generators");