mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
upgrade regions format version to 3
This commit is contained in:
parent
69b90f53c3
commit
e30c1b3c03
15 changed files with 138 additions and 149 deletions
|
|
@ -172,6 +172,17 @@ bool WorldFiles::readResourcesData(const Content* content) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void WorldFiles::patchIndicesVersion(const std::string& field, uint version) {
|
||||
fs::path file = getIndicesFile();
|
||||
if (!fs::is_regular_file(file)) {
|
||||
logger.error() << file.filename().u8string() << " does not exists";
|
||||
return;
|
||||
}
|
||||
auto root = files::read_json(file);
|
||||
root->put(field, version);
|
||||
files::write_json(file, root.get(), true);
|
||||
}
|
||||
|
||||
static void erase_pack_indices(dynamic::Map* root, const std::string& id) {
|
||||
auto prefix = id + ":";
|
||||
auto blocks = root->list("blocks");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue