diff --git a/src/main/java/com/jelly/MightyMiner/baritone/automine/pathing/AStarPathFinder.java b/src/main/java/com/jelly/MightyMiner/baritone/automine/pathing/AStarPathFinder.java index da23f85c..996ade2e 100644 --- a/src/main/java/com/jelly/MightyMiner/baritone/automine/pathing/AStarPathFinder.java +++ b/src/main/java/com/jelly/MightyMiner/baritone/automine/pathing/AStarPathFinder.java @@ -185,8 +185,9 @@ private LinkedList calculatePath(BlockPos startingPos, BlockPos endin if (goalNode.blockPos.equals(currentNode.blockPos)) { completedPathfind = true; } - if(step > 3000) + if(step > 30000) { + Logger.playerLog("Steps exceeded"); throw new Exception(); } } @@ -208,6 +209,7 @@ private void openNodeAndCalculateCost(Node searchNode, Node currentNode, BlockPo if (allowedMiningBlocks != null && !allowedMiningBlocks.contains(BlockUtils.getBlock(searchNode.blockPos)) && !BlockUtils.getBlock(searchNode.blockPos).equals(Blocks.air)) return; } + BlockRenderer.renderMap.put(searchNode.blockPos, Color.cyan); searchNode.opened = true; searchNode.lastNode = currentNode; @@ -314,13 +316,13 @@ private void calculateCost(Node node, BlockPos endingBlock){ else node.gValue = 1f; - node.gValue *= BlockUtils.isPassable(node.blockPos) ? 0.5f : 2f; + // node.gValue *= BlockUtils.isPassable(node.blockPos) ? 0.5f : 2f; node.fValue = node.gValue + node.hValue; } private int calculatePathCost(List nodes){ int cost = 0; for(BlockNode node : nodes){ - cost += (node.getBlockType() == BlockType.WALK) ? 1 : 2; + cost += (node.getBlockType() == BlockType.WALK) ? 2 : 1; } return cost; } @@ -330,6 +332,6 @@ BlockType getBlockType (BlockPos blockToSearch) { } double getHeuristic(BlockPos start, BlockPos goal){ - return MathUtils.getDistanceBetweenTwoBlock(start, goal) * (BlockUtils.isPassable(goal) ? 0.5f : 2f); + return MathUtils.getDistanceBetweenTwoBlock(start, goal); } }