ProjectKig / KigPaper

Paper 1.8.8 fork with critical performance tweaks, bug fixes and gameplay improvements.
https://playkig.com
43 stars 11 forks source link

Add PlayerTrackEntityEvent #8

Open archer-321 opened 2 years ago

archer-321 commented 2 years ago

This PR adds a KigPaper-API way to hide entities from players. This change is useful when using entities to display something while not wanting other players to see the "visual noise".

roccodev commented 2 years ago

I don't think this should be fired for player entities. As you explain, the proper way to hide players is via Player#hidePlayer, which already takes care of disabling trackers.

archer-321 commented 2 years ago

While this new API might mislead some users into implementing a vanish system from scratch, I think artificially limiting an API only because someone might not read the Javadoc isn't the right way to go. Moreover, players are entities, so when the event claims that it's going to be fired for all entities (and if we leave the doc comments as they are right now), skipping the event for players would be a faulty implementation.

Originally, I had the event's Javadoc explicitly state that cancelling the event only hides the "player model" in-game while leaving everything else that mentions the player in place. Do you think that with this part added back to the class' comment, the chance of potential misuse would be acceptably low?