-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix hitbox issues on newer versions of minecraft #116
base: master
Are you sure you want to change the base?
Conversation
thoughts @IceTank ? |
@SilkePilon Did you base these changes on any differences you found between the current prismarine-physics code and the Java code? This might trigger anti cheat plugins if horizontal collisions don't line up anymore between Java and prismarine-physics. |
@@ -115,7 +115,7 @@ function Physics (mcData, world) { | |||
if (block) { | |||
const blockPos = block.position | |||
for (const shape of block.shapes) { | |||
const blockBB = new AABB(shape[0], shape[1], shape[2], shape[3], shape[4], shape[5]) | |||
const blockBB = new AABB(shape[0] - 0.01, shape[1], shape[2] - 0.01, shape[3] + 0.01, shape[4], shape[5] + 0.01) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining why the bounding box is increased here?
Also, this check now applies for all versions. It might be better to do this version specific. As far as I know, it was working fine in older versions of the game.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change at a recommendation of vakore on Discord. Apparently the current system isn't perfect at handling hitbox's. As sometimes the hitbox ends up inside a block and makes the bot unable to move by extending the hitbox a bit this fixes the issue sometimes. Tho it's not a perfect solution and more of a "hack". |
In newer versions of minecraft there are some minor changes to the hitbox system
this wont affect older versions.
examples of the bug:
![imagdwae](https://private-user-images.githubusercontent.com/64040187/346716345-d7d65b78-410c-48d8-b1f9-0b474a4ea06b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2NjY3ODUsIm5iZiI6MTcyNDY2NjQ4NSwicGF0aCI6Ii82NDA0MDE4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