diff --git a/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramManager.java b/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramManager.java index b961f74c..84caea8c 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramManager.java +++ b/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramManager.java @@ -7,6 +7,7 @@ import eu.decentsoftware.holograms.api.utils.file.FileUtils; import eu.decentsoftware.holograms.api.utils.scheduler.S; import eu.decentsoftware.holograms.api.utils.tick.Ticked; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -34,7 +35,7 @@ public HologramManager() { public void tick() { for (Hologram hologram : Hologram.getCachedHolograms()) { if (!hologram.isEnabled()) continue; - for (Player player : hologram.getLocation().getWorld().getPlayers()) { + for (Player player : Bukkit.getOnlinePlayers()) { if (!hologram.isVisible(player) && hologram.canShow(player) && hologram.isInDisplayRange(player)) { hologram.show(player, hologram.getPlayerPage(player)); } else if (hologram.isVisible(player) && !(hologram.canShow(player) && hologram.isInDisplayRange(player))) { diff --git a/src/main/java/eu/decentsoftware/holograms/api/player/PlayerListener.java b/src/main/java/eu/decentsoftware/holograms/api/player/PlayerListener.java index f701def8..12c6f957 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/player/PlayerListener.java +++ b/src/main/java/eu/decentsoftware/holograms/api/player/PlayerListener.java @@ -6,7 +6,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerRespawnEvent; @@ -41,10 +40,10 @@ public void onRespawn(PlayerRespawnEvent e) { Hologram.getCachedHolograms().forEach(hologram -> hologram.hide(player)); } - @EventHandler - public void onTeleport(PlayerChangedWorldEvent e) { - Player player = e.getPlayer(); - Hologram.getCachedHolograms().forEach(hologram -> hologram.hide(player)); - } +// @EventHandler +// public void onTeleport(PlayerChangedWorldEvent e) { +// Player player = e.getPlayer(); +// Hologram.getCachedHolograms().forEach(hologram -> hologram.hide(player)); +// } }