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

Improve world border logic #1314

Merged
merged 1 commit into from
May 12, 2024
Merged

Improve world border logic #1314

merged 1 commit into from
May 12, 2024

Conversation

Pablete1234
Copy link
Member

Currently worldborder checks are not lenient enough for odd-block sized borders, like if the border is at half the block, the vanilla client will let you walk the full block, but pgm will teleport you back. This makes borders very annoying as valid vanilla movements will cause setbacks.

Ontop of that, world borders in vanilla are actually composed of not just size and center, but also a max world size. This means the world borders can actually be rectangles, and therefore can't be checked with a simple abs(x - center.x) < radius, as that just doesn't hold true. To add insult to injury, bukkit exposes none of this and pretends borders are always square, completely ignoring on the api-side the existance of max world size, which means in pgm you could fly right thru the max world size.

To end, a funny rectangular world border:
image

@Pablete1234 Pablete1234 added the bug Something isn't working label May 4, 2024
@Pablete1234 Pablete1234 requested a review from Electroid as a code owner May 4, 2024 16:06
Signed-off-by: Pablo Herrera <[email protected]>
@Pablete1234 Pablete1234 force-pushed the fix-worldborder-checks branch from c82ffae to 9f20fec Compare May 4, 2024 16:35
@Pablete1234 Pablete1234 added the ready PR is ready to merge label May 6, 2024
@Electroid Electroid merged commit 3bffdeb into dev May 12, 2024
2 checks passed
@Electroid Electroid deleted the fix-worldborder-checks branch May 12, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PR is ready to merge
Development

Successfully merging this pull request may close these issues.

2 participants