fix exception when calculating descend from starting position above 256
This commit is contained in:
parent
8a65f43a0b
commit
c5f5445f4b
@ -111,6 +111,9 @@ public final class AStarPathFinder extends AbstractNodeCostSearch implements Hel
|
|||||||
if (!moves.dynamicXZ && !worldBorder.entirelyContains(newX, newZ)) {
|
if (!moves.dynamicXZ && !worldBorder.entirelyContains(newX, newZ)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((currentNode.y == 256 && moves.yOffset > 0) || (currentNode.y == 0 && moves.yOffset < 0)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
res.reset();
|
res.reset();
|
||||||
moves.apply(calcContext, currentNode.x, currentNode.y, currentNode.z, res);
|
moves.apply(calcContext, currentNode.x, currentNode.y, currentNode.z, res);
|
||||||
numMovementsConsidered++;
|
numMovementsConsidered++;
|
||||||
|
@ -148,7 +148,7 @@ public enum Moves {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DESCEND_EAST(+1, 0, 0, false, true) {
|
DESCEND_EAST(+1, -1, 0, false, true) {
|
||||||
@Override
|
@Override
|
||||||
public Movement apply0(BetterBlockPos src) {
|
public Movement apply0(BetterBlockPos src) {
|
||||||
MutableMoveResult res = new MutableMoveResult();
|
MutableMoveResult res = new MutableMoveResult();
|
||||||
@ -166,7 +166,7 @@ public enum Moves {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DESCEND_WEST(-1, 0, 0, false, true) {
|
DESCEND_WEST(-1, -1, 0, false, true) {
|
||||||
@Override
|
@Override
|
||||||
public Movement apply0(BetterBlockPos src) {
|
public Movement apply0(BetterBlockPos src) {
|
||||||
MutableMoveResult res = new MutableMoveResult();
|
MutableMoveResult res = new MutableMoveResult();
|
||||||
@ -184,7 +184,7 @@ public enum Moves {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DESCEND_NORTH(0, 0, -1, false, true) {
|
DESCEND_NORTH(0, -1, -1, false, true) {
|
||||||
@Override
|
@Override
|
||||||
public Movement apply0(BetterBlockPos src) {
|
public Movement apply0(BetterBlockPos src) {
|
||||||
MutableMoveResult res = new MutableMoveResult();
|
MutableMoveResult res = new MutableMoveResult();
|
||||||
@ -202,7 +202,7 @@ public enum Moves {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
DESCEND_SOUTH(0, 0, +1, false, true) {
|
DESCEND_SOUTH(0, -1, +1, false, true) {
|
||||||
@Override
|
@Override
|
||||||
public Movement apply0(BetterBlockPos src) {
|
public Movement apply0(BetterBlockPos src) {
|
||||||
MutableMoveResult res = new MutableMoveResult();
|
MutableMoveResult res = new MutableMoveResult();
|
||||||
|
Loading…
Reference in New Issue
Block a user