Pathfinding improvements [Anti Cheat Fix, Client Side Movement] #156
+48
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎯 Pathfinding Improvements & Anti-Cheat Enhancements
This PR introduces critical fixes to the pathfinding system and movement logic to improve reliability and prevent anti-cheat detection.
📝 Changes
1. Enhanced PathExecutor Movement Logic (Anti-Cheat Prevention)
Refactored movement system to use client-side WASD key presses based on current player rotation instead of forced server-side rotation
Disabled StrafeUtil during pathfinding to make movement appear more natural and human-like
Implemented realistic key press calculation using KeyBindUtil.getNeededKeyPresses() to determine which WASD keys to press based on the player's current facing direction
Preserved attack/use item states during navigation to prevent interruptions
Improved jump detection by checking if jumps are needed based on the current player rotation, not target rotation
This makes the bot's movement purely client-side and indistinguishable from legitimate player input, significantly reducing anti-cheat detection risk
2. Extended Pathfinding Timer
Added timeout extension logic in RouteNavigator to prevent premature pathfinding failures
Automatic timer extension of 5 seconds when pathfinding is still in progress but approaching timeout
Better error logging to distinguish between legitimate failures and timeouts
Fixes issues where complex paths would timeout before completion