|
22 | 22 | import baritone.api.pathing.goals.Goal; |
23 | 23 | import baritone.api.pathing.movement.ActionCosts; |
24 | 24 | import baritone.api.utils.BetterBlockPos; |
| 25 | +import baritone.api.utils.SettingsUtil; |
25 | 26 | import baritone.pathing.calc.openset.BinaryHeapOpenSet; |
26 | 27 | import baritone.pathing.movement.CalculationContext; |
27 | 28 | import baritone.pathing.movement.Moves; |
@@ -122,17 +123,39 @@ protected Optional<IPath> calculate0(long primaryTimeout, long failureTimeout) { |
122 | 123 | continue; |
123 | 124 | } |
124 | 125 | if (actionCost <= 0 || Double.isNaN(actionCost)) { |
125 | | - throw new IllegalStateException(moves + " calculated implausible cost " + actionCost); |
| 126 | + throw new IllegalStateException(String.format( |
| 127 | + "%s from %s %s %s calculated implausible cost %s", |
| 128 | + moves, |
| 129 | + SettingsUtil.maybeCensor(currentNode.x), |
| 130 | + SettingsUtil.maybeCensor(currentNode.y), |
| 131 | + SettingsUtil.maybeCensor(currentNode.z), |
| 132 | + actionCost)); |
126 | 133 | } |
127 | | - // check destination after verifying it's not COST_INF -- some movements return a static IMPOSSIBLE object with COST_INF and destination being 0,0,0 to avoid allocating a new result for every failed calculation |
| 134 | + // check destination after verifying it's not COST_INF -- some movements return COST_INF without adjusting the destination |
128 | 135 | if (moves.dynamicXZ && !worldBorder.entirelyContains(res.x, res.z)) { // see issue #218 |
129 | 136 | continue; |
130 | 137 | } |
131 | 138 | if (!moves.dynamicXZ && (res.x != newX || res.z != newZ)) { |
132 | | - throw new IllegalStateException(moves + " " + res.x + " " + newX + " " + res.z + " " + newZ); |
| 139 | + throw new IllegalStateException(String.format( |
| 140 | + "%s from %s %s %s ended at x z %s %s instead of %s %s", |
| 141 | + moves, |
| 142 | + SettingsUtil.maybeCensor(currentNode.x), |
| 143 | + SettingsUtil.maybeCensor(currentNode.y), |
| 144 | + SettingsUtil.maybeCensor(currentNode.z), |
| 145 | + SettingsUtil.maybeCensor(res.x), |
| 146 | + SettingsUtil.maybeCensor(res.z), |
| 147 | + SettingsUtil.maybeCensor(newX), |
| 148 | + SettingsUtil.maybeCensor(newZ))); |
133 | 149 | } |
134 | 150 | if (!moves.dynamicY && res.y != currentNode.y + moves.yOffset) { |
135 | | - throw new IllegalStateException(moves + " " + res.y + " " + (currentNode.y + moves.yOffset)); |
| 151 | + throw new IllegalStateException(String.format( |
| 152 | + "%s from %s %s %s ended at y %s instead of %s", |
| 153 | + moves, |
| 154 | + SettingsUtil.maybeCensor(currentNode.x), |
| 155 | + SettingsUtil.maybeCensor(currentNode.y), |
| 156 | + SettingsUtil.maybeCensor(currentNode.z), |
| 157 | + SettingsUtil.maybeCensor(res.y), |
| 158 | + SettingsUtil.maybeCensor(currentNode.y + moves.yOffset))); |
136 | 159 | } |
137 | 160 | long hashCode = BetterBlockPos.longHash(res.x, res.y, res.z); |
138 | 161 | if (isFavoring) { |
|
0 commit comments