mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-08 20:01:25 +01:00
Fixed holograms from being displayed too far away after teleporting
This commit is contained in:
parent
f5abe32f6e
commit
c269cea82b
@ -2,10 +2,13 @@ package de.epiceric.shopchest.listeners;
|
||||
|
||||
import de.epiceric.shopchest.ShopChest;
|
||||
import de.epiceric.shopchest.event.ShopUpdateEvent;
|
||||
import de.epiceric.shopchest.shop.Shop;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class ShopUpdateListener implements Listener {
|
||||
|
||||
@ -22,4 +25,12 @@ public class ShopUpdateListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerJoin(PlayerJoinEvent e) {
|
||||
for (Shop shop : plugin.getShopUtils().getShops()) {
|
||||
shop.getHologram().hidePlayer(e.getPlayer());
|
||||
shop.getItem().setVisible(e.getPlayer(), false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ public class ShopUtils {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (shop.getHologram() != null && shop.getHologram().isVisible(player)) shop.getHologram().hidePlayer(player);
|
||||
if (shop.getHologram() != null) shop.getHologram().hidePlayer(player);
|
||||
}
|
||||
|
||||
if (distSqr <= itemDistSqr) {
|
||||
|
Loading…
Reference in New Issue
Block a user