Move display holograms around

This commit is contained in:
fullwall 2024-05-31 11:31:22 +08:00
parent 224b43d75b
commit f9e78c732d

View File

@ -784,8 +784,10 @@ public class HologramTrait extends Trait {
if (color != null) { if (color != null) {
disp.setBackgroundColor(color); disp.setBackgroundColor(color);
} }
hologram.getEntity().teleport(npc.getStoredLocation().clone().add(offset.x, hologram.getEntity().teleport(
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()), offset.z), TeleportCause.PLUGIN); npc.getStoredLocation().clone().add(offset.x,
offset.y + NMS.getBoundingBoxHeight(npc.getEntity()) + 0.2f, offset.z),
TeleportCause.PLUGIN);
} }
public void setBackgroundColor(Color color) { public void setBackgroundColor(Color color) {
@ -819,7 +821,7 @@ public class HologramTrait extends Trait {
disp.setInterpolationDuration(0); disp.setInterpolationDuration(0);
disp.setBillboard(Billboard.CENTER); disp.setBillboard(Billboard.CENTER);
Transformation tf = disp.getTransformation(); Transformation tf = disp.getTransformation();
tf.getTranslation().y = (float) offset.y + 0.7f; tf.getTranslation().y = (float) offset.y + 0.4f;
disp.setTransformation(tf); disp.setTransformation(tf);
if (color != null) { if (color != null) {
disp.setBackgroundColor(color); disp.setBackgroundColor(color);