baritone
baritone copied to clipboard
Fix for infinite loop in water
This is a slightly dodgy solution, however it is the simplest one I could think of.
Description of issue
When a fall into more than 2 block deep water occurs baritone enters an infinite loop as we swim up, to the surface, and end the movement when we "jump" above the water, this means that our position isn't in the valid positions of a traverse movement. And thus some of the lag protection jumps in and resets us to the fall (as this is a valid position for during the fall), entering an infinite loop.
Closes #3200.
If anyone can think of a better solution to this please let me know
would some kind of isWater check make this less dodgy?
would some kind of isWater check make this less dodgy?
It would but that would complicate things and I can't really think of a situation in which this will really do any harm, if someone can think of one then then I'll add a check, but otherwise I think it is just unnecessary complication.
If Baritone mines straight down and then traverses (tunneling under a lava lake?) but the server lags right after the the last MovementDownward ended, setting Baritone back to the beginning of the last MovementDownward before the block was mined, this will cause the path to fail after 5-10s instead of fixing it instantly.
Treating a position A as valid because the position B below it is valid should only be allowed if B is canWalkThrough and not canWalkOn (or even better, only if the player is actually unsupported).
This now should instead make baritone only swim up to 0.6 of a way through a block, so instead of jumping out above the water we just swim along through it.
shouldn't this have targeted 1.16.5?
If this is because of post-aquatic swimming mechanics then yes. Though I don't think master would be that wrong either.
shouldn't this have targeted 1.16.5?
Do we still support 1.16.5? If so then probably, but thought we'd decided to deprecate it.
Iirc it got un deprecated
Oh, ok, I missed that, this could probably just go on master so I'll make a pr for that later.