only walk through supported snow, fixes #276

This commit is contained in:
Leijurv 2018-11-26 15:32:28 -08:00
parent 58d9134286
commit a8404a7286
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -92,7 +92,11 @@ public interface MovementHelper extends ActionCosts, Helper {
if (snow) { if (snow) {
// the check in BlockSnow.isPassable is layers < 5 // the check in BlockSnow.isPassable is layers < 5
// while actually, we want < 3 because 3 or greater makes it impassable in a 2 high ceiling // while actually, we want < 3 because 3 or greater makes it impassable in a 2 high ceiling
return state.getValue(BlockSnow.LAYERS) < 3; if (state.getValue(BlockSnow.LAYERS) >= 3) {
return false;
}
// ok, it's low enough we could walk through it, but is it supported?
return canWalkOn(bsi, x, y - 1, z);
} }
if (trapdoor) { if (trapdoor) {
return !state.getValue(BlockTrapDoor.OPEN); // see BlockTrapDoor.isPassable return !state.getValue(BlockTrapDoor.OPEN); // see BlockTrapDoor.isPassable