filoghost / HolographicDisplays

Create modern looking holograms in Minecraft.

Home Page:https://dev.bukkit.org/projects/holographic-displays

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Armorstand cant be in each other.

MinecraftGamer001 opened this issue · comments

Confirmation

  • I have read the FAQ.
  • I have tested the latest development build of Holographic Displays and the bug is still present.
  • I have updated Spigot to the latest release for my particular Minecraft version.
  • I made sure the bug hasn't already been reported on the issue tracker.

Description

Hello, i use the holographicdisplays api and now i used the VisibilityManager to show per player their level in the hologram.
Now when i do this it works and only the player the hologram is meant to be for can see it.
But when another player joins their hologram will be under the invisible other hologram.

It is hard to explain but i have a picture for it:
image (1)
On the left side you see the second hologram when a second player joins, and on the right side you see the first hologram.
It is about the Level hologram.

How to reproduce

Use this code:

@EventHandler
    public void onPlayerJoin(final PlayerJoinEvent e) {
        final Player p = e.getPlayer();
        for (final Crate c : Main.getCrates()) {
            if (c.configKey.contains("daily")) {
                Location location = (Location) Main.getConfiguration().getConfig().get("crates." + c.configKey + ".location");
                LobbyLevel lobby = new LobbyLevel();
                String level = lobby.getLevel(p);
                HolographicDisplaysAPI api = HolographicDisplaysAPI.get(Main.getInstance());
                final Hologram hologram2 = api.createHologram(location.subtract(0, 0.25, 0));
                hologram2.getVisibilitySettings().setGlobalVisibility(Visibility.HIDDEN);
                Bukkit.getScheduler().runTaskLater(Main.instance, () -> {
                	hologram2.getVisibilitySettings().setIndividualVisibility(p, Visibility.VISIBLE);
                }, 5L);
                TextHologramLine textLine12 = hologram2.getLines().appendText(Utils.colorize("&fLevel " + level));
                textLine12.setText(Utils.colorize("&fLevel " + level));
            }
        }
    }

When you join with 2 accounts you can see on the last one joined the hologram is under the invisible one.
I use HolographicDisplays v3.0.2.

Server version

This server is running Paper version git-Paper-1620 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)

Holographic Displays version

HolographicDisplays v3.0.2 (also tried v3.0.3)

Installed plugins that allow players to join with multiple Minecraft versions

ViaVersion, ViaBackwards.

Additional information

No response