Skip to content

Commit

Permalink
Check hologram height on spawn properly
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Sep 21, 2021
1 parent 49559e2 commit 620cda6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main/src/main/java/net/citizensnpcs/trait/HologramTrait.java
Expand Up @@ -95,7 +95,8 @@ private double getEntityHeight() {
}

private double getHeight(int lineNumber) {
return (lineHeight == -1 ? Setting.DEFAULT_NPC_HOLOGRAM_LINE_HEIGHT.asDouble() : lineHeight) * (lineNumber + 1);
return (lineHeight == -1 ? Setting.DEFAULT_NPC_HOLOGRAM_LINE_HEIGHT.asDouble() : lineHeight)
* (lastNameplateVisible ? lineNumber + 1 : lineNumber);
}

/**
Expand Down Expand Up @@ -212,8 +213,7 @@ public void run() {
if (!hologramNPC.isSpawned())
continue;
if (update) {
hologramNPC.teleport(
currentLoc.clone().add(0, getEntityHeight() + getHeight(nameplateVisible ? i : i - 1), 0),
hologramNPC.teleport(currentLoc.clone().add(0, getEntityHeight() + getHeight(i), 0),
TeleportCause.PLUGIN);
}
if (i >= lines.size()) {
Expand Down

0 comments on commit 620cda6

Please sign in to comment.