mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
fix some skylight bugs
This commit is contained in:
parent
8974a31371
commit
a2624c4c43
@ -364,17 +364,17 @@ class SectionLight(
|
||||
if (target != Directions.UP && (target == null || lightProperties.propagatesLight(Directions.DOWN))) {
|
||||
if (y > 0) {
|
||||
traceSkylightIncrease(x, y - 1, z, nextNeighbourLevel, Directions.DOWN, totalY - 1)
|
||||
} else if (section.sectionHeight != chunk.maxSection) {
|
||||
(neighbours[Directions.O_DOWN] ?: chunk.getOrPut(section.sectionHeight + 1, false))?.light?.traceSkylightIncrease(x, ProtocolDefinition.SECTION_MAX_Y, z, nextNeighbourLevel, Directions.DOWN, totalY - 1)
|
||||
} else if (section.sectionHeight == chunk.minSection) {
|
||||
chunk.light.bottom.traceSkyIncrease(x, z, nextLevel)
|
||||
} else {
|
||||
(neighbours[Directions.O_DOWN] ?: chunk.getOrPut(section.sectionHeight - 1, false))?.light?.traceSkylightIncrease(x, ProtocolDefinition.SECTION_MAX_Y, z, nextNeighbourLevel, Directions.DOWN, totalY - 1)
|
||||
}
|
||||
}
|
||||
if (target != Directions.DOWN && target != null && (lightProperties.propagatesLight(Directions.UP))) {
|
||||
if (y < ProtocolDefinition.SECTION_MAX_Y) {
|
||||
traceSkylightIncrease(x, y + 1, z, nextNeighbourLevel, Directions.UP, totalY + 1)
|
||||
} else if (section.sectionHeight == chunk.minSection) {
|
||||
chunk.light.bottom.traceSkyIncrease(x, z, nextLevel)
|
||||
} else {
|
||||
(neighbours[Directions.O_UP] ?: chunk.getOrPut(section.sectionHeight - 1, false))?.light?.traceSkylightIncrease(x, 0, z, nextNeighbourLevel, Directions.UP, totalY + 1)
|
||||
} else if (section.sectionHeight < chunk.maxSection) {
|
||||
(neighbours[Directions.O_UP] ?: chunk.getOrPut(section.sectionHeight + 1, false))?.light?.traceSkylightIncrease(x, 0, z, nextNeighbourLevel, Directions.UP, totalY + 1)
|
||||
}
|
||||
}
|
||||
if (target != Directions.SOUTH && (target == null || lightProperties.propagatesLight(Directions.NORTH))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user