Fixes compatibility with DecentHolograms

This commit is contained in:
Christian Koop 2023-06-24 10:58:56 +02:00
parent dea440732e
commit da0e877d03
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 6 additions and 4 deletions

View File

@ -44,6 +44,7 @@ import java.util.concurrent.TimeUnit;
public class AnchorManagerImpl implements AnchorManager {
private static final String ERR_WORLD_NOT_READY = "EpicAnchors has not finished initializing that world yet";
private static final String HOLOGRAM_PREFIX = "Anchor_";
private final SongodaPlugin plugin;
private final DataManager dataManager;
@ -395,12 +396,12 @@ public class AnchorManagerImpl implements AnchorManager {
for (Anchor anchor : anchors) {
List<String> lines = Collections.singletonList(formatAnchorText(anchor.getTicksLeft(), true));
if (!HologramManager.isHologramLoaded("Anchor#" + anchor.getDbId())) {
HologramManager.createHologram("Anchor#" + anchor.getDbId(), anchor.getLocation(), lines);
if (!HologramManager.isHologramLoaded(HOLOGRAM_PREFIX + anchor.getDbId())) {
HologramManager.createHologram(HOLOGRAM_PREFIX + anchor.getDbId(), anchor.getLocation(), lines);
continue;
}
hologramData.put("Anchor#" + anchor.getDbId(), lines);
hologramData.put(HOLOGRAM_PREFIX + anchor.getDbId(), lines);
}
// Create the holograms
@ -472,6 +473,6 @@ public class AnchorManagerImpl implements AnchorManager {
}
private static void removeHologram(Anchor anchor) {
HologramManager.removeHologram("Anchor#" + anchor.getDbId());
HologramManager.removeHologram(HOLOGRAM_PREFIX + anchor.getDbId());
}
}

View File

@ -8,6 +8,7 @@ softdepend:
- Holograms
- HolographicDisplays
- Vault
- DecentHolograms
author: Craftaro
authors: [ SpraxDev ]