go in the opposite order

This commit is contained in:
Leijurv 2018-12-04 15:33:29 -08:00
parent 862746038d
commit 21d8c11cfe
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -212,7 +212,7 @@ public class MovementParkour extends Movement {
if (!MovementHelper.canWalkOn(ctx, dest.down()) && !ctx.player().onGround) { if (!MovementHelper.canWalkOn(ctx, dest.down()) && !ctx.player().onGround) {
BlockPos positionToPlace = dest.down(); BlockPos positionToPlace = dest.down();
for (int i = 0; i < 5; i++) { for (int i = 4; i >= 0; i--) { // go in the opposite order to check DOWN before all horizontals -- down is preferable because you don't have to look to the side while in midair, which could mess up the trajectory
BlockPos against1 = positionToPlace.offset(HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP[i]); BlockPos against1 = positionToPlace.offset(HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP[i]);
if (against1.up().equals(src.offset(direction, 3))) { // we can't turn around that fast if (against1.up().equals(src.offset(direction, 3))) { // we can't turn around that fast
continue; continue;