also check where we might hit our head

This commit is contained in:
Leijurv 2018-09-06 10:14:41 -07:00
parent b746e56631
commit 9757422626
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -66,7 +66,8 @@ public class MovementParkour extends Movement {
}
for (int i = 2; i <= 4; i++) {
BlockPos dest = src.offset(dir, i);
for (int y = 0; y < 3; y++) {
// TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?
for (int y = 0; y < 4; y++) {
if (!MovementHelper.fullyPassable(dest.up(y))) {
return null;
}
@ -101,7 +102,7 @@ public class MovementParkour extends Movement {
}
for (int i = 1; i <= 4; i++) {
BlockPos d = src.offset(direction, i);
for (int y = 0; y < 3; y++) {
for (int y = 0; y < 4; y++) {
if (!MovementHelper.fullyPassable(d.up(y))) {
return COST_INF;
}