diff --git a/renderer/viewer/lib/worldrendererCommon.ts b/renderer/viewer/lib/worldrendererCommon.ts index ae36f204..d0ad8133 100644 --- a/renderer/viewer/lib/worldrendererCommon.ts +++ b/renderer/viewer/lib/worldrendererCommon.ts @@ -266,14 +266,15 @@ export abstract class WorldRendererCommon return this.highestBlocksByChunks.get(chunkKey) } - updateCustomBlock (chunkKey: string, blockKey: number | string, blockPos: { x: number, y: number, z: number }, model: string) { + updateCustomBlock (chunkKey: string, blockPos: string, model: string) { this.protocolCustomBlocks.set(chunkKey, { ...this.protocolCustomBlocks.get(chunkKey), - [blockKey]: model + [blockPos]: model }) - this.logWorkerWork(() => `-> updateCustomBlock ${chunkKey} ${blockKey} ${model} ${this.wasChunkSentToWorker(chunkKey)}`) + this.logWorkerWork(() => `-> updateCustomBlock ${chunkKey} ${blockPos} ${model} ${this.wasChunkSentToWorker(chunkKey)}`) if (this.wasChunkSentToWorker(chunkKey)) { - this.setBlockStateId(new Vec3(blockPos.x, blockPos.y, blockPos.z), undefined) + const [x, y, z] = blockPos.split(',').map(Number) + this.setBlockStateId(new Vec3(x, y, z), undefined) } } diff --git a/src/customChannels.ts b/src/customChannels.ts index 784d9921..57c057d5 100644 --- a/src/customChannels.ts +++ b/src/customChannels.ts @@ -69,7 +69,7 @@ const registerBlockModelsChannel = () => { const chunkKey = `${chunkX},${chunkZ}` const blockPosKey = `${x},${y},${z}` - getThreeJsRendererMethods()?.updateCustomBlock(chunkKey, blockPosKey, { x: Number(x), y: Number(y), z: Number(z) }, model) + getThreeJsRendererMethods()?.updateCustomBlock(chunkKey, blockPosKey, model) }, true) }