mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
update WorldConverter (WIP)
This commit is contained in:
parent
3f826a88d3
commit
728795f0f3
12 changed files with 299 additions and 97 deletions
|
|
@ -81,6 +81,15 @@ std::unique_ptr<dynamic::Map> Inventory::serialize() const {
|
|||
return map;
|
||||
}
|
||||
|
||||
void Inventory::convert(const ContentReport* report) {
|
||||
for (auto& slot : slots) {
|
||||
itemid_t id = slot.getItemId();
|
||||
itemid_t replacement = report->items.getId(id);
|
||||
slot.set(ItemStack(replacement, slot.getCount()));
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: remove
|
||||
void Inventory::convert(dynamic::Map* data, const ContentReport* report) {
|
||||
auto slotsarr = data->list("slots");
|
||||
for (size_t i = 0; i < slotsarr->size(); i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue