Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Add Entity hidden by default flag

Open jstnf opened this issue 3 years ago • 2 comments
trafficstars

Allows entities to be hidden by default. Entities that are hidden by default are hidden from a Player until Player#showEntity is invoked on that entity. Players that join the server or relog will also not see entities that are hidden by default. The entity's tracker maintains a set of player connections that have been shown the entity.

Entities hidden by default respect other plugins' calls to Player#hideEntity. This means that, if Player#showEntity is called on an entity hidden by default, but the method was not called by the plugin that originally hid the entity, then the entity will still not be shown. If no other plugin hides the player when it is shown, then the entity will remain hidden by default but be shown to that Player.

The functionality is expanded for players that are hidden by default. Hiding players by default will send REMOVE_PLAYER PlayerInfo packets so that they are hidden in a similar fashion to hidePlayer calls. The same can be said when a player is no longer being hidden by default.

Test with my own test plugins, that hide entities and players by default and then show them to specific players. Leaving and rejoining was also tested.

Closes #7395

jstnf avatar Aug 24 '22 12:08 jstnf

I know that the logic is not the same as https://github.com/PaperMC/Paper/pull/7666 but it close the same issue, so you should probably find a solution together

Lulu13022002 avatar Aug 24 '22 14:08 Lulu13022002

I know that the logic is not the same as #7666 but it close the same issue, so you should probably find a solution together

How should I go about doing this?

jstnf avatar Aug 24 '22 14:08 jstnf

Rebased and removed the streams.

jstnf avatar Dec 02 '22 03:12 jstnf

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/e8010dc93fbb163876d6c745970dd2d9b587b381?

molor avatar Mar 13 '23 07:03 molor

Done by upstream https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/fb50924403915ad24e9389361a10dfbf53c1e696

Machine-Maker avatar Mar 20 '23 05:03 Machine-Maker