Skip to content

Commit aeb0ba2

Browse files
authored
fix(voxel-renderer): add missing blocks definitions when saving world (#219)
1 parent 3ac563e commit aeb0ba2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.changeset/witty-sites-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jolly-pixel/voxel.renderer": patch
3+
---
4+
5+
Add missing blocks definition when saving on VoxelRenderer

packages/voxel-renderer/src/VoxelRenderer.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,13 @@ export class VoxelRenderer extends ActorComponent {
473473
save(): VoxelWorldJSON {
474474
this.#logger.debug("Serializing world to JSON...");
475475

476-
return this.serializer.serialize(
477-
this.world,
478-
this.tilesetManager
479-
);
476+
return {
477+
...this.serializer.serialize(
478+
this.world,
479+
this.tilesetManager
480+
),
481+
blocks: [...this.blockRegistry.getAll()]
482+
};
480483
}
481484

482485
async load(

0 commit comments

Comments
 (0)