add inShown check to new holograms
stops holograms stacking
This commit is contained in:
parent
75f680c480
commit
92d3403b51
|
@ -87,10 +87,12 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
|
|||
originalhologram.hide(targetPlayer); // essentially destroy the hologram
|
||||
textDisplayHolograms.remove(targetPlayer.getUniqueId()); // remove the old obj
|
||||
}
|
||||
|
||||
Hologram hologram = getPlayerHologram(targetPlayer); //
|
||||
List<Object> updatePackets = hologram.getUpdatePackets(getPlayerLines(targetPlayer));
|
||||
hologram.update(targetPlayer, updatePackets);
|
||||
|
||||
if (isShown(targetPlayer)) { //only show hologram if the player is in range
|
||||
Hologram hologram = getPlayerHologram(targetPlayer);
|
||||
List<Object> updatePackets = hologram.getUpdatePackets(getPlayerLines(targetPlayer));
|
||||
hologram.update(targetPlayer, updatePackets);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue