tree impl test; falling blocks won't destroy transparent blocks

This commit is contained in:
minjaesong
2019-07-31 01:38:27 +09:00
parent 155c38536f
commit 864b6cd5a0
12 changed files with 32 additions and 16 deletions

View File

@@ -194,7 +194,7 @@ object WorldSimulator {
for (y in updateYTo downTo updateYFrom) {
val currentTile = world.getTileFromTerrain(x, y)
val prop = BlockCodex[currentTile]
val isSolid = prop.isSolid
val isAir = currentTile == Block.AIR
val support = prop.maxSupport
val isFallable = support != -1
@@ -211,10 +211,10 @@ object WorldSimulator {
fallableStackProcessed = true
}
else if (isSolid) {
else if (!isAir) {
fallDownCounter = 0
}
else if (!isSolid && !isFallable && fallDownCounter < FALLABLE_MAX_FALL_SPEED) {
else if (!isFallable && fallDownCounter < FALLABLE_MAX_FALL_SPEED) {
fallDownCounter += 1
}
}