Fix chunk tickets being removed when Citizens is disabled, return correct NPC entity in HologramTrait

This commit is contained in:
fullwall 2021-09-17 19:04:52 +08:00
parent 7952600382
commit cdb7cbba4a
2 changed files with 3 additions and 1 deletions

View File

@ -443,6 +443,8 @@ public class CitizensNavigator implements Navigator, Runnable {
}
private void updateTicket(Location target) {
if (!CitizensAPI.hasImplementation() || !CitizensAPI.getPlugin().isEnabled())
return;
if (target != null && this.activeTicket != null
&& new ChunkCoord(target.getChunk()).equals(new ChunkCoord(this.activeTicket.getChunk()))) {
this.activeTicket = target.clone();

View File

@ -127,7 +127,7 @@ public class HologramTrait extends Trait {
* Note: this is implementation-specific and may be removed at a later date.
*/
public ArmorStand getNameEntity() {
return nameNPC != null && nameNPC.isSpawned() ? ((ArmorStand) npc.getEntity()) : null;
return nameNPC != null && nameNPC.isSpawned() ? ((ArmorStand) nameNPC.getEntity()) : null;
}
@Override