Skip to content

Commit

Permalink
experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
d0by1 committed Dec 1, 2021
1 parent 0e1b4eb commit 3c2479f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
// }

}

0 comments on commit 3c2479f

Please sign in to comment.