fix: some areas in old world were competely white
This commit is contained in:
parent
547525d615
commit
7d699f24bb
2 changed files with 7 additions and 2 deletions
|
|
@ -65,6 +65,7 @@ function setSectionDirty (pos, value = true) {
|
|||
const softCleanup = () => {
|
||||
// clean block cache and loaded chunks
|
||||
world = new World(world.config.version)
|
||||
globalThis.world = world
|
||||
}
|
||||
|
||||
const handleMessage = data => {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ export class World {
|
|||
}
|
||||
|
||||
getLight (pos: Vec3, isNeighbor = false, skipMoreChecks = false, curBlockName = '') {
|
||||
// for easier testing
|
||||
if (!(pos instanceof Vec3)) pos = new Vec3(...pos as [number, number, number])
|
||||
const { enableLighting, skyLight } = this.config
|
||||
if (!enableLighting) return 15
|
||||
// const key = `${pos.x},${pos.y},${pos.z}`
|
||||
|
|
@ -70,8 +72,10 @@ export class World {
|
|||
this.getLight(pos.offset(1, 0, 0), undefined, true),
|
||||
this.getLight(pos.offset(-1, 0, 0), undefined, true)
|
||||
].filter(x => x !== 2)
|
||||
const min = Math.min(...lights)
|
||||
result = min
|
||||
if (lights.length) {
|
||||
const min = Math.min(...lights)
|
||||
result = min
|
||||
}
|
||||
}
|
||||
if (isNeighbor && result === 2) result = 15 // TODO
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue