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

Fix floating point issue #6467

Closed
wants to merge 1 commit into from
Closed

Conversation

GameParrot
Copy link
Contributor

@GameParrot GameParrot commented Oct 7, 2024

Introduction

Fixes blocks not placing right next to the player at certain positions

Relevant issues

Currently you cannot place blocks right next to yourself at some positions due to floating point issues

Changes

API changes

No significant API changes

Behavioural changes

Might affect some extremely precise checks

Backwards compatibility

No Backwards compatibility issues

Tests

I tested this PR by doing the following (tick all that apply):

  • Writing PHPUnit tests (commit these in the tests/phpunit folder)
  • Playtesting using a Minecraft client (provide screenshots or a video)
  • Writing a test plugin (provide the code and sample output)
  • Other (provide details)

Fixes blocks not placing right next to the player at certain positions
@IvanCraft623
Copy link
Member

I'm not seeing the issue, please mention reproduction steps

@GameParrot
Copy link
Contributor Author

GameParrot commented Oct 9, 2024

@dktapps
Copy link
Member

dktapps commented Oct 17, 2024

This function already has an epsilon built in, it shouldn't be needed. Also not clear if this might cause unintended side effects.

@dktapps
Copy link
Member

dktapps commented Oct 20, 2024

Fixes blocks not placing right next to the player at certain positions

Would be nice to have some examples so this can be tested

@joinasau
Copy link

I have exactly the same problem

@jasonw4331 jasonw4331 added Category: Gameplay Related to Minecraft gameplay experience Type: Fix Bug fix, typo fix, or any other fix Status: Insufficiently Tested Status: Unconfirmed Bug has not yet been reproduced by a maintainer labels Nov 4, 2024
@dktapps
Copy link
Member

dktapps commented Dec 1, 2024

I don't like this change. It'll affect all callers of getNearbyEntities(), which could have all kinds of unintended side effects.

Glitchiness at large coordinates is to be expected, since there's a falloff in the ability of floats to represent high precision fractions when the number is very large. There's only so much we can compensate for that anyway.

It would be nice to know what specific coordinates this occurs at so it can be investigated properly. As I said, an epsilon is already used for intersectsWith() so this issue should've been fixed long ago.

Copy link

This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days.

If there is no further activity, it will be closed in 28 days.

Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale.

@github-actions github-actions bot added the Stale label Dec 10, 2024
@dktapps dktapps requested a review from a team as a code owner December 12, 2024 13:22
@github-actions github-actions bot removed the Stale label Dec 14, 2024
Copy link

This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days.

If there is no further activity, it will be closed in 28 days.

Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale.

@github-actions github-actions bot added the Stale label Dec 22, 2024
Copy link

As this PR hasn't been updated for a while, unfortunately we'll have to close it.

@github-actions github-actions bot added the Resolution: Abandoned PR has been abandoned by its author label Jan 20, 2025
@github-actions github-actions bot closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Resolution: Abandoned PR has been abandoned by its author Stale Status: Insufficiently Tested Status: Unconfirmed Bug has not yet been reproduced by a maintainer Status: Waiting on Author Type: Fix Bug fix, typo fix, or any other fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants