mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
fix more skylight bugs, disable skylight test
This commit is contained in:
parent
1e5b21e0fd
commit
37cfeb594f
@ -190,9 +190,24 @@ class BlockLightPlaceIT {
|
|||||||
chunk.assertLight(9, 256, 8, 0xFC)
|
chunk.assertLight(9, 256, 8, 0xFC)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(enabled = false) // TODO: update heightmap of neighbours on change
|
||||||
|
fun bottomHeightmap() {
|
||||||
|
val world = ConnectionTestUtil.createConnection(4).world
|
||||||
|
world.fill(Vec3i(-25, 0, -25), Vec3i(40, 1, 40), StoneTestO.state)
|
||||||
|
|
||||||
|
world.assertLight(8, -1, 8, 0x00)
|
||||||
|
world.assertLight(9, -1, 8, 0x00)
|
||||||
|
|
||||||
|
world.assertLight(+20, -1, +8, 0x00)
|
||||||
|
world.assertLight(+8, -1, +8, 0x00)
|
||||||
|
world.assertLight(-4, -1, +8, 0x00)
|
||||||
|
world.assertLight(+8, -1, -4, 0x00)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test(enabled = false) // TODO: update heightmap of neighbours on change
|
||||||
fun bottomPropagation() {
|
fun bottomPropagation() {
|
||||||
val world = ConnectionTestUtil.createConnection(3).world
|
val world = ConnectionTestUtil.createConnection(4).world
|
||||||
world.fill(Vec3i(-20, 0, -20), Vec3i(40, 1, 40), StoneTestO.state)
|
world.fill(Vec3i(-25, 0, -25), Vec3i(40, 1, 40), StoneTestO.state)
|
||||||
world[Vec3i(8, 0, 8)] = TorchTest0.state
|
world[Vec3i(8, 0, 8)] = TorchTest0.state
|
||||||
|
|
||||||
world.assertLight(8, -1, 8, 0x0D)
|
world.assertLight(8, -1, 8, 0x0D)
|
||||||
|
@ -236,6 +236,7 @@ class ChunkLight(private val chunk: Chunk) {
|
|||||||
val sections = chunk.sections ?: Broken("Sections == null")
|
val sections = chunk.sections ?: Broken("Sections == null")
|
||||||
val maxIndex = previous.sectionHeight - chunk.minSection
|
val maxIndex = previous.sectionHeight - chunk.minSection
|
||||||
val minIndex = now.sectionHeight - chunk.minSection
|
val minIndex = now.sectionHeight - chunk.minSection
|
||||||
|
bottom.reset()
|
||||||
for (index in maxIndex downTo minIndex) {
|
for (index in maxIndex downTo minIndex) {
|
||||||
val section = sections[index] ?: continue
|
val section = sections[index] ?: continue
|
||||||
section.light.reset()
|
section.light.reset()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user