mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 02:25:57 +01:00
Hologram trait bugfix
This commit is contained in:
parent
0fc644b21f
commit
ee9c67fc0c
@ -694,6 +694,13 @@ public class HologramTrait extends Trait {
|
||||
itemNPC = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Entity> getEntities() {
|
||||
return itemNPC != null && itemNPC.getEntity() != null
|
||||
? ImmutableList.of(hologram.getEntity(), itemNPC.getEntity())
|
||||
: Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void render0(NPC npc, Vector3d offset) {
|
||||
hologram.getEntity().teleport(npc.getStoredLocation().clone().add(offset.x,
|
||||
@ -743,7 +750,8 @@ public class HologramTrait extends Trait {
|
||||
|
||||
@Override
|
||||
public void render(NPC npc, Vector3d offset) {
|
||||
if (hologram == null) {
|
||||
if (getEntities().isEmpty()) {
|
||||
destroy();
|
||||
spawnHologram(npc, offset);
|
||||
}
|
||||
render0(npc, offset);
|
||||
|
Loading…
Reference in New Issue
Block a user