From 0b79c392b0ccfb4f942a2463b3a04c2c3c353187 Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 27 Nov 2020 23:31:21 +0800 Subject: [PATCH] Some plugins rely on specific metadata ordering --- main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index af234a5eb..34550745b 100644 --- a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -246,6 +246,7 @@ public class CitizensNPC extends AbstractNPC { getOrAddTrait(CurrentLocation.class).setLocation(at); entityController.spawn(at.clone(), this); + getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true)); boolean loaded = Util.isLoaded(at); boolean couldSpawn = !loaded ? false : NMS.addEntityToWorld(getEntity(), CreatureSpawnEvent.SpawnReason.CUSTOM); @@ -260,7 +261,6 @@ public class CitizensNPC extends AbstractNPC { Bukkit.getPluginManager().callEvent(new NPCNeedsRespawnEvent(this, at)); return false; } - getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true)); // send skin packets, if applicable, before other NMS packets are sent SkinnableEntity skinnable = getEntity() instanceof SkinnableEntity ? ((SkinnableEntity) getEntity()) : null; if (skinnable != null) {