diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java b/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java index 32cdf28..1472ade 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/ZNpcsPlus.java @@ -142,7 +142,7 @@ public class ZNpcsPlus extends JavaPlugin { shutdownTasks.add(adventure::close); if (configManager.getConfig().autoSaveEnabled()) shutdownTasks.add(npcRegistry::save); - NpcApiProvider.register(this, new ZNPCsPlusApi(npcRegistry, typeRegistry, propertyRegistry)); + NpcApiProvider.register(this, new ZNpcsPlusApi(npcRegistry, typeRegistry, propertyRegistry)); enabled = true; log(ChatColor.WHITE + " * Loading complete! (" + (System.currentTimeMillis() - before) + "ms)"); log(""); @@ -156,6 +156,7 @@ public class ZNpcsPlus extends JavaPlugin { entry.setProcessed(true); NpcImpl npc = entry.getNpc(); npc.getHologram().addLineComponent(Component.text("Hello, World!")); + npc.setProperty(propertyRegistry.getByName("look", Boolean.class), true); i++; } } diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java index 513d1da..29261f1 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/packets/V1_8PacketFactory.java @@ -81,7 +81,7 @@ public class V1_8PacketFactory implements PacketFactory { public void teleportEntity(Player player, PacketEntity entity) { NpcLocation location = entity.getLocation(); sendPacket(player, new WrapperPlayServerEntityTeleport(entity.getEntityId(), npcLocationToVector(location), location.getYaw(), location.getPitch(), true)); - if (entity.getType() == EntityTypes.PLAYER) sendPacket(player, new WrapperPlayServerEntityHeadLook(entity.getEntityId(), location.getYaw())); + sendPacket(player, new WrapperPlayServerEntityHeadLook(entity.getEntityId(), location.getYaw())); } @Override diff --git a/plugin/src/main/java/lol/pyr/znpcsplus/tasks/NpcProcessorTask.java b/plugin/src/main/java/lol/pyr/znpcsplus/tasks/NpcProcessorTask.java index 67efca9..b211eb9 100644 --- a/plugin/src/main/java/lol/pyr/znpcsplus/tasks/NpcProcessorTask.java +++ b/plugin/src/main/java/lol/pyr/znpcsplus/tasks/NpcProcessorTask.java @@ -61,7 +61,7 @@ public class NpcProcessorTask extends BukkitRunnable { } // look property if (closest != null && npc.getProperty(lookProperty) && lookPropertyDistSq >= closestDist) { - NpcLocation expected = npc.getLocation().lookingAt(closest.getLocation()); + NpcLocation expected = npc.getLocation().lookingAt(closest.getLocation().add(0, -npc.getType().getHologramOffset(), 0)); if (!expected.equals(npc.getLocation())) npc.setLocation(expected); } }