mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-27 19:47:51 +01:00
Fix name tags affecting NPC names
This commit is contained in:
parent
cda3171a87
commit
18b98eb609
@ -64,7 +64,7 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
}
|
}
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
getEntity().getLocation().getChunk().load();
|
getEntity().getLocation().getChunk();
|
||||||
Messaging.debug("Couldn't despawn", getId(), "due to despawn event cancellation. Force loaded chunk.");
|
Messaging.debug("Couldn't despawn", getId(), "due to despawn event cancellation. Force loaded chunk.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -230,6 +230,9 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
|
|
||||||
if (!getNavigator().isNavigating()
|
if (!getNavigator().isNavigating()
|
||||||
&& getEntity().getWorld().getFullTime() % Setting.PACKET_UPDATE_DELAY.asInt() == 0) {
|
&& getEntity().getWorld().getFullTime() % Setting.PACKET_UPDATE_DELAY.asInt() == 0) {
|
||||||
|
if (getEntity() instanceof LivingEntity) {
|
||||||
|
((LivingEntity) getEntity()).setCustomName(getFullName());
|
||||||
|
}
|
||||||
Player player = getEntity() instanceof Player ? (Player) getEntity() : null;
|
Player player = getEntity() instanceof Player ? (Player) getEntity() : null;
|
||||||
NMS.sendPacketNearby(player, getStoredLocation(),
|
NMS.sendPacketNearby(player, getStoredLocation(),
|
||||||
new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity())));
|
new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity())));
|
||||||
|
Loading…
Reference in New Issue
Block a user