Hologram Visibility Manager issue
MikyPro opened this issue ยท 4 comments
Description
I'm using PaperSpigot 1.8.8 and i have the latest version of ProtocolLib, i'm setting the visibility to only one player using the tutorial given in the github's wiki:
`
infoHologram = HologramsAPI.createHologram(plugin, location);
infoHologram.getVisibilityManager().showTo(player);
infoHologram.getVisibilityManager().setVisibleByDefault(false);
//Adding the lines here`
But the hologram is visible to all the online players, i tried to avoid the setVisibleByDefault(boolean) method by looping trough all the players and hide the hologram for each player that is not "player variable" and it worked but it is so inefficient. Some help?
How to reproduce
Create an hologram, show it to a player, set it invisible by default (to make it visible only to the player) and add the lines.
Platform
- Server version (output of
/version
):
This server is running CraftBukkit version git-PaperSpigot-"4c7641d" (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT) - Holographic Displays version (check with
/hd
):
Server is running Holographic Displays v2.4.4 by filoghost - ProtocolLib version, if installed (check with
/protocol version
):
ProtocolLib v4.5.1
[23:05:27 INFO]: Authors: dmulloy2 and Comphenix - Do you use plugins to allow players to join with multiple Minecraft versions (such as ViaVersion, ProtocolSupport, ...):
ViaVersion 3.0.1
Additional context
N/A
Please try the new beta version on Bukkit Dev. It doesn't use ProtocolLib anymore.
@filoghost why my issue got ignored?
Here's a patch that fixes it for 1.8: ProjectKig@294afbc
Basically, the World.a(Entity)
method (validateEntityMethod
) first updates the entity trackers, which results in spawn packets being sent to players before the entitiesById
map is updated with the entity ID. This causes ProtocolLib packet listeners to fail to hide the entity because they can't find it from its ID.
I haven't tested if the issue occurs on later versions.