revert custom channel change

This commit is contained in:
Vitaly Turovsky 2025-06-13 13:26:00 +03:00
commit 02a1be8eea
2 changed files with 6 additions and 5 deletions

View file

@ -266,14 +266,15 @@ export abstract class WorldRendererCommon<WorkerSend = any, WorkerReceive = any>
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)
}
}

View file

@ -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)
}