Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathfinding can fail with IllegalStateException when sneaking off a block #4528

Open
4 tasks done
ZacSharp opened this issue Oct 20, 2024 · 7 comments · May be fixed by #4532
Open
4 tasks done

Pathfinding can fail with IllegalStateException when sneaking off a block #4528

ZacSharp opened this issue Oct 20, 2024 · 7 comments · May be fixed by #4532
Labels
bug Something isn't working

Comments

@ZacSharp
Copy link
Collaborator

Some information

Operating system: Linux
Java version: 21
Minecraft version: 1.20.6
Baritone version: fd8af9b
Other mods (if used): Litematica 1.18.1 + Malilib 1.19.0

(i.e. the workspace I used to test #4527)

Exception, error or logs

[16:31:28] [Render thread/INFO]: [CHAT] [Baritone] > path
[16:31:28] [Render thread/INFO]: [CHAT] [Baritone] Now pathing
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]: java.lang.IllegalStateException: Path doubles back on itself, making a loop
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at baritone.api.pathing.calc.IPath.sanityCheck(IPath.java:174)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at baritone.pathing.calc.Path.postProcess(Path.java:156)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at java.base/java.util.Optional.map(Optional.java:260)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at baritone.pathing.calc.AbstractNodeCostSearch.calculate(AbstractNodeCostSearch.java:106)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at baritone.behavior.PathingBehavior.lambda$findPathInNewThread$2(PathingBehavior.java:506)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[16:31:28] [pool-6-thread-3/INFO]: [STDERR]:    at java.base/java.lang.Thread.run(Thread.java:1583)

How to reproduce

Sneak off of an edge and set a goal such that the shortest path from the supporting block to the goal leads through your current position, then start the pathfinder.
E.g. like this:
2024-10-20_16 31 28

Modified settings

None

Final checklist

  • I know how to properly use check boxes
  • I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
  • I have included logs, exceptions and / or steps to reproduce the issue.
  • I have not inserted any OwO's or UwU's into this issue.
@ZacSharp ZacSharp added the bug Something isn't working label Oct 20, 2024
@babbaj
Copy link
Collaborator

babbaj commented Oct 20, 2024

Couldn't reproduce. Do you have baritone somehow configured so that it walks over the hole? I don't get an error if it parkours over the hole or falls into it.

@ZacSharp
Copy link
Collaborator Author

Yes, I used default settings (i.e. no parkour) and had a dirt block in my hand so it would scaffold back over the hole.

@leijurv
Copy link
Member

leijurv commented Oct 20, 2024

This is indeed a tricky case because the "correct" path here does indeed double back on itself!

@babbaj
Copy link
Collaborator

babbaj commented Oct 20, 2024

I think we can either fix the sanity check so it runs before we add the new node or only add the node if A* returned nothing (should be equal to checking if pathStart = goal like in the original solution)

@leijurv
Copy link
Member

leijurv commented Oct 20, 2024

only add the node if A* returned nothing

not sure if that works, wouldn't that make it fall into the hole in this example without placing the block? or no?

@ZacSharp
Copy link
Collaborator Author

The pathfinder would still start above the supporting block so no, unless it also did so for the last couple years.

@babbaj
Copy link
Collaborator

babbaj commented Oct 20, 2024

It would just make it walk onto the supporting block(pathStart()) which should be the goal if A* returned nothing

babbaj added a commit to babbaj/baritone that referenced this issue Oct 21, 2024
@babbaj babbaj linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants