mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
workaround light for non opaque blocks
This commit is contained in:
parent
1d134f3bb2
commit
ca7973017d
@ -125,10 +125,10 @@ data class BlockState(
|
||||
val outlineShape = data["outline_shape"]?.asShape() ?: VoxelShape.EMPTY
|
||||
|
||||
|
||||
val lightProperties = if (outlineShape == VoxelShape.EMPTY) {
|
||||
val lightProperties = if (outlineShape == VoxelShape.EMPTY || data["is_opaque"]?.toBoolean() == false) {
|
||||
TransparentProperty
|
||||
} else if (outlineShape == VoxelShape.FULL) {
|
||||
if (data["is_opaque"]?.toBoolean() != false) SolidProperty else TransparentProperty
|
||||
SolidProperty
|
||||
} else {
|
||||
DirectedProperty.of(outlineShape)
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ class DirectedProperty(private val directions: BooleanArray) : LightProperties {
|
||||
return isSideCovered(`in`) && isSideCovered(out) // ToDo: That could go wrong
|
||||
}
|
||||
|
||||
@Deprecated("Absolutely trash")
|
||||
fun VoxelShape.isSideCovered(side: Directions): Boolean {
|
||||
// ToDo: This whole calculation is technically wrong, it could be that 2 different sides of 2 blocks are "free". That means that light can still not pass the blocks, but
|
||||
// this algorithm does not cover it. Let's see it as performance hack
|
||||
|
Loading…
x
Reference in New Issue
Block a user