more accurate check

This commit is contained in:
Leijurv 2018-10-12 15:29:25 -07:00
parent 4892192c6c
commit b443be1795
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -111,7 +111,7 @@ public final class AStarPathFinder extends AbstractNodeCostSearch implements Hel
if (!moves.dynamicXZ && !worldBorder.entirelyContains(newX, newZ)) {
continue;
}
if ((currentNode.y == 256 && moves.yOffset > 0) || (currentNode.y == 0 && moves.yOffset < 0)) {
if (currentNode.y + moves.yOffset > 256 || currentNode.y + moves.yOffset < 0) {
continue;
}
res.reset();