diff --git a/pom.xml b/pom.xml index 7dd2b72..505e316 100644 --- a/pom.xml +++ b/pom.xml @@ -6,8 +6,7 @@ com.songoda EpicAnchors - 2.0.0-ALPHA - + 2.2.0 EpicAnchors Allow your players to keep chunks loaded for a limited amount of time for a cost. @@ -150,7 +149,7 @@ com.songoda SongodaCore - 2.5.8 + 2.6.10 compile @@ -158,7 +157,7 @@ org.jetbrains annotations - 21.0.1 + 23.0.0 compile diff --git a/src/main/java/com/songoda/epicanchors/AnchorManager.java b/src/main/java/com/songoda/epicanchors/AnchorManager.java index 88513f8..13b2998 100644 --- a/src/main/java/com/songoda/epicanchors/AnchorManager.java +++ b/src/main/java/com/songoda/epicanchors/AnchorManager.java @@ -425,11 +425,17 @@ public class AnchorManager { // are holograms enabled? if (!Settings.HOLOGRAMS.getBoolean() || !HologramManager.getManager().isEnabled()) return; - Map> hologramData = new HashMap<>(anchors.size()); + Map> hologramData = new HashMap<>(anchors.size()); for (Anchor anchor : anchors) { - hologramData.put(anchor.getLocation(), - Collections.singletonList(formatAnchorText(anchor.getTicksLeft(), true))); + List lines = Collections.singletonList(formatAnchorText(anchor.getTicksLeft(), true)); + + if (!HologramManager.isHologramLoaded("Anchor#" + anchor.getDbId())) { + HologramManager.createHologram("Anchor#" + anchor.getDbId(), anchor.getLocation(), lines); + continue; + } + + hologramData.put("Anchor#" + anchor.getDbId(), lines); } // Create the holograms @@ -466,6 +472,6 @@ public class AnchorManager { } private static void removeHologram(Anchor anchor) { - HologramManager.removeHologram(anchor.getLocation()); + HologramManager.removeHologram("Anchor#" + anchor.getDbId()); } }