diff --git a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java index d3466b5d7..457aba91e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/npc/NpcManager.java @@ -13,6 +13,7 @@ import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.configuration.InvalidConfigurationException; @@ -345,6 +346,7 @@ public class NpcManager extends MiniPlugin { UtilEnt.Vegetate(entity); UtilEnt.silence(entity, true); + UtilEnt.ghost(entity, true, false); } if (npc.getDatabaseRecord().getHelmet() != null) @@ -421,7 +423,10 @@ public class NpcManager extends MiniPlugin if (npc.getFailedAttempts() >= 10 || npc.getDatabaseRecord().getRadius() == 0) { - entity.teleport(npc.getLocation()); + Location location = npc.getLocation(); + location.setPitch(entity.getLocation().getPitch()); + location.setYaw(entity.getLocation().getYaw()); + entity.teleport(location); entity.setVelocity(new Vector(0, 0, 0)); npc.setFailedAttempts(0); } @@ -457,7 +462,10 @@ public class NpcManager extends MiniPlugin if (!entity.isDead() && entity.isValid()) { - entity.teleport(npc.getLocation()); + Location location = npc.getLocation(); + location.setPitch(entity.getLocation().getPitch()); + location.setYaw(entity.getLocation().getYaw()); + entity.teleport(location); entity.setVelocity(new Vector(0, 0, 0)); npc.setFailedAttempts(0); @@ -557,7 +565,10 @@ public class NpcManager extends MiniPlugin UtilEnt.ghost(entity, true, false); if (npc.getDatabaseRecord().getRadius() == 0) + { UtilEnt.Vegetate(entity); + UtilEnt.ghost(entity, true, false); + } } if (isDetachedNpc((LivingEntity) entity))