lol you can't jump with a ceiling above you

This commit is contained in:
Leijurv 2018-09-06 10:13:50 -07:00
parent 915b03a44e
commit b746e56631
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
1 changed files with 8 additions and 10 deletions

View File

@ -66,11 +66,10 @@ public class MovementParkour extends Movement {
}
for (int i = 2; i <= 4; i++) {
BlockPos dest = src.offset(dir, i);
if (!MovementHelper.fullyPassable(dest)) {
return null;
}
if (!MovementHelper.fullyPassable(dest.up())) {
return null;
for (int y = 0; y < 3; y++) {
if (!MovementHelper.fullyPassable(dest.up(y))) {
return null;
}
}
if (MovementHelper.canWalkOn(dest.down())) {
return new MovementParkour(src, i, dir);
@ -102,11 +101,10 @@ public class MovementParkour extends Movement {
}
for (int i = 1; i <= 4; i++) {
BlockPos d = src.offset(direction, i);
if (!MovementHelper.fullyPassable(d)) {
return COST_INF;
}
if (!MovementHelper.fullyPassable(d.up())) {
return COST_INF;
for (int y = 0; y < 3; y++) {
if (!MovementHelper.fullyPassable(d.up(y))) {
return COST_INF;
}
}
if (d.equals(dest)) {
return costFromJumpDistance(i);