revert custom channel change
This commit is contained in:
parent
b3807fff65
commit
02a1be8eea
2 changed files with 6 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue