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

small hitbox and sink fix #715

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wolfebersahd
Copy link

It fixed the off-by-1 hitbox math and the hardcoded y < 5 sink limits

Checklist

  • [DONE] Proper internationalization (i hope i did it correctly)
  • [DONE] Tested (on a separate fork with other changes)

Changed hardcoded sink limit from `y < 5` to `y < (craft.getWorld().getMinHeight() + 5)` preserving the original 4 block buffer but accounting for the new minimum world heights of 1.18+
Adjusted X, Y, Z, lengths by +1 to compensate for coordinate vs block math.
@@ -293,7 +293,7 @@ private void processSinking() {
if (!(craft instanceof SinkingCraft))
continue;

if (craft.getHitBox().isEmpty() || craft.getHitBox().getMinY() < 5) {
if (craft.getHitBox().isEmpty() || craft.getHitBox().getMinY() < (craft.getWorld().getMinHeight() +5 )) {
Copy link
Collaborator

@oh-noey oh-noey Sep 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought but is their really any reason we even check for it being 5 over the min in the firs place 🤔

Copy link
Author

@wolfebersahd wolfebersahd Sep 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it on my fork and everything works fine. I kept it here because I didn't know if there were any other classes that need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants