add inShown check to new holograms

stops holograms stacking
This commit is contained in:
Gatt
2020-07-16 22:28:37 +10:00
parent 75f680c480
commit 92d3403b51
@@ -88,10 +88,12 @@ public abstract class NPCBase implements NPC, NPCPacketHandler {
textDisplayHolograms.remove(targetPlayer.getUniqueId()); // remove the old obj textDisplayHolograms.remove(targetPlayer.getUniqueId()); // remove the old obj
} }
Hologram hologram = getPlayerHologram(targetPlayer); // if (isShown(targetPlayer)) { //only show hologram if the player is in range
Hologram hologram = getPlayerHologram(targetPlayer);
List<Object> updatePackets = hologram.getUpdatePackets(getPlayerLines(targetPlayer)); List<Object> updatePackets = hologram.getUpdatePackets(getPlayerLines(targetPlayer));
hologram.update(targetPlayer, updatePackets); hologram.update(targetPlayer, updatePackets);
} }
}
return this; return this;
} }