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

ViewEngine passenger bug #2081

Open
MelonHell opened this issue Apr 5, 2024 · 3 comments
Open

ViewEngine passenger bug #2081

MelonHell opened this issue Apr 5, 2024 · 3 comments

Comments

@MelonHell
Copy link
Contributor

MelonHell commented Apr 5, 2024

I have a player who has invisibility player.isAutoViewable = false
The player has an entity on his head (passenger) that only that player should see
After the player comes out of invisibility player.isAutoViewable = true the entity also becomes visible but should not

The current implementation of ViewEngine is terrible. It works extremely unpredictably and has many bugs. I think it needs a complete rework. For example, I cannot use ViewEngine for custom objects that do not implements Entity

@DeidaraMC
Copy link
Collaborator

Could you share more of the unpredictability and "many bugs" you've come across with the view engine?
It would help give us more of a push to justify a rewrite

@MelonHell
Copy link
Contributor Author

It will be difficult for me to name specific bugs, but I have often had cases when something is shown, although it is hidden and vice versa. There is definitely a problem with passengers; they are almost always processed incorrectly. I would also like to be able to use ViewAPI more flexibly, for example, I use models consisting of several entities and it would be convenient if ViewAPI could accept not only Entities, but also a custom Model class that would proxy calls to all entities at once

@MelonHell
Copy link
Contributor Author

MelonHell commented Apr 24, 2024

Also, this part seems very dirty to me. I don't think this code should be in Player. I think ViewAPI should have a separate method for something like this

this.instance.getEntityTracker().nearbyEntitiesByChunkRange(respawnPosition, settings.getEffectiveViewDistance(),
EntityTracker.Target.ENTITIES, entity -> {
// Skip refreshing self with a new viewer
if (!entity.getUuid().equals(uuid) && entity.isViewer(this)) {
entity.updateNewViewer(this);
}
});

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

No branches or pull requests

2 participants