mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-17 04:41:31 +01:00
Check hologram height on spawn properly
This commit is contained in:
parent
49559e26bc
commit
620cda6542
@ -95,7 +95,8 @@ public class HologramTrait extends Trait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private double getHeight(int lineNumber) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -212,8 +213,7 @@ public class HologramTrait extends Trait {
|
|||||||
if (!hologramNPC.isSpawned())
|
if (!hologramNPC.isSpawned())
|
||||||
continue;
|
continue;
|
||||||
if (update) {
|
if (update) {
|
||||||
hologramNPC.teleport(
|
hologramNPC.teleport(currentLoc.clone().add(0, getEntityHeight() + getHeight(i), 0),
|
||||||
currentLoc.clone().add(0, getEntityHeight() + getHeight(nameplateVisible ? i : i - 1), 0),
|
|
||||||
TeleportCause.PLUGIN);
|
TeleportCause.PLUGIN);
|
||||||
}
|
}
|
||||||
if (i >= lines.size()) {
|
if (i >= lines.size()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user