Skip to content

feat: Detect when player is within map bounds #692

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zachthedev
Copy link

Issue

If there are multiple maps, the player shows up on the lowest priority map of the same dimension but not where the rendered part of chunks are.

Use case

A nether map with roof transparency and then another map that is only the roof and above (to showcase redstone builds, etc).

  • Clicking on a player on a different map, will take the user to the correct map for viewing what they are working on

- Issue: if there are multiple maps, the player shows up on the lowest priority map of the same dimension but not where the rendered part of chunks are.
- Use case: A nether map with roof transparency and then another map that is only the roof and above (to showcase redstone builds, etc).
    - Clicking on a player on a different map, will take the user to the correct map for viewing what they are working on
Copy link
Member

@TBlueF TBlueF left a comment

Choose a reason for hiding this comment

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

I actually forgot to review this PR, sorry ..
Here are my thoughts:

The implementation looks good! There is just the problem that this implementation will clash with the plans to make the map-render-boundaries more versatile: #81

The plan here is to make it possible to add all kinds of shapes which can be defined in the map-config for in or excluding them, and even make it possible to extend this with addons.

To make the webapp compatible with this, i would suggest a server-side approach .. where instead of the webapp knowing the map-boundaries and having it calculate if the player is out of bounds, send the player.outOfBounds from the server and let the server calculate that boolean.
This way the server can easily be extended by more complex map-boundaries and the webapp doesn't need to mirror all that logic.

@zachthedev
Copy link
Author

@TBlueF No worries! That totally makes sense. I had actually started on that approach to refactor this PR, but time got away from me. I plan to pick it back up sometime in the next week or so.

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