mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Merge pull request #877 from Lolmewn/patch-1
Add NPC_METADATA_MARKER before teleporting
This commit is contained in:
commit
7d11994b3d
@ -196,6 +196,8 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
|
|
||||||
entityController.spawn(at, this);
|
entityController.spawn(at, this);
|
||||||
|
|
||||||
|
getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true));
|
||||||
|
|
||||||
boolean couldSpawn = !Util.isLoaded(at) ? false : NMS.addEntityToWorld(getEntity(), SpawnReason.CUSTOM);
|
boolean couldSpawn = !Util.isLoaded(at) ? false : NMS.addEntityToWorld(getEntity(), SpawnReason.CUSTOM);
|
||||||
|
|
||||||
// send skin packets, if applicable, before other NMS packets are sent
|
// send skin packets, if applicable, before other NMS packets are sent
|
||||||
@ -219,8 +221,6 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
|
|
||||||
NMS.setHeadYaw(getEntity(), at.getYaw());
|
NMS.setHeadYaw(getEntity(), at.getYaw());
|
||||||
|
|
||||||
getEntity().setMetadata(NPC_METADATA_MARKER, new FixedMetadataValue(CitizensAPI.getPlugin(), true));
|
|
||||||
|
|
||||||
// Set the spawned state
|
// Set the spawned state
|
||||||
getTrait(CurrentLocation.class).setLocation(at);
|
getTrait(CurrentLocation.class).setLocation(at);
|
||||||
getTrait(Spawned.class).setSpawned(true);
|
getTrait(Spawned.class).setSpawned(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user