diff --git a/src/main/java/de/oliver/fancyholograms/HologramManagerImpl.java b/src/main/java/de/oliver/fancyholograms/HologramManagerImpl.java index 9cb32a3..f4aef5a 100644 --- a/src/main/java/de/oliver/fancyholograms/HologramManagerImpl.java +++ b/src/main/java/de/oliver/fancyholograms/HologramManagerImpl.java @@ -3,6 +3,7 @@ import com.google.common.cache.CacheBuilder; import com.google.common.collect.ImmutableList; import de.oliver.fancyholograms.api.HologramManager; +import de.oliver.fancyholograms.api.data.DisplayHologramData; import de.oliver.fancyholograms.api.data.HologramData; import de.oliver.fancyholograms.api.data.TextHologramData; import de.oliver.fancyholograms.api.events.HologramsLoadedEvent; @@ -14,6 +15,7 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.UnmodifiableView; +import org.joml.Vector3f; import java.time.Duration; import java.util.*; @@ -299,7 +301,13 @@ public void syncHologramWithNpc(@NotNull final Hologram hologram) { npc.getData().setShowInTab(false); npc.updateForAll(); - final var location = npc.getData().getLocation().clone().add(0, npc.getEyeHeight() + 0.5, 0); + final var npcScale = npc.getData().getScale(); + + if(hologram.getData() instanceof DisplayHologramData displayData) { + displayData.setScale(new Vector3f(npcScale)); + } + + final var location = npc.getData().getLocation().clone().add(0, (npc.getEyeHeight() * npcScale) + (0.5 * npcScale), 0); hologram.getData().setLocation(location); } } diff --git a/src/main/java/de/oliver/fancyholograms/listeners/NpcListener.java b/src/main/java/de/oliver/fancyholograms/listeners/NpcListener.java index 99b6d39..dc8ae30 100644 --- a/src/main/java/de/oliver/fancyholograms/listeners/NpcListener.java +++ b/src/main/java/de/oliver/fancyholograms/listeners/NpcListener.java @@ -34,7 +34,7 @@ public void onModify(@NotNull final NpcModifyEvent event) { final var holograms = this.plugin.getHologramsManager().getHolograms(); switch (event.getModification()) { - case TYPE, LOCATION -> { + case TYPE, LOCATION, SCALE -> { final var needsToBeUpdated = holograms.stream() .filter(hologram -> event.getNpc().getData().getName().equals(hologram.getData().getLinkedNpcName())) .toList();