ignore saving npc location for closest player look type, used packet instead
This commit is contained in:
parent
d48e4bc2b2
commit
28ed99a3b7
2 changed files with 7 additions and 1 deletions
|
@ -87,6 +87,12 @@ public class NpcImpl extends Viewable implements Npc {
|
||||||
entity.setHeadRotation(player, yaw, pitch);
|
entity.setHeadRotation(player, yaw, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHeadRotation(float yaw, float pitch) {
|
||||||
|
for (Player player : getViewers()) {
|
||||||
|
entity.setHeadRotation(player, yaw, pitch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public HologramImpl getHologram() {
|
public HologramImpl getHologram() {
|
||||||
return hologram;
|
return hologram;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class NpcProcessorTask extends BukkitRunnable {
|
||||||
if (lookType.equals(LookType.CLOSEST_PLAYER)) {
|
if (lookType.equals(LookType.CLOSEST_PLAYER)) {
|
||||||
if (closest != null && lookPropertyDistSq >= closestDist) {
|
if (closest != null && lookPropertyDistSq >= closestDist) {
|
||||||
NpcLocation expected = npc.getLocation().lookingAt(closest.getLocation().add(0, -npc.getType().getHologramOffset(), 0));
|
NpcLocation expected = npc.getLocation().lookingAt(closest.getLocation().add(0, -npc.getType().getHologramOffset(), 0));
|
||||||
if (!expected.equals(npc.getLocation())) npc.setLocation(expected);
|
if (!expected.equals(npc.getLocation())) npc.setHeadRotation(expected.getYaw(), expected.getPitch());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue