mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-10-02 09:08:02 +02:00
Added onNPCSpawn method to Trait.
This commit is contained in:
parent
458efb9152
commit
1293c1f7fb
@ -131,6 +131,10 @@ public abstract class CitizensNPC extends AbstractNPC {
|
|||||||
getTrait(SpawnLocation.class).setLocation(loc);
|
getTrait(SpawnLocation.class).setLocation(loc);
|
||||||
// Set the spawned state
|
// Set the spawned state
|
||||||
getTrait(Spawned.class).setSpawned(true);
|
getTrait(Spawned.class).setSpawned(true);
|
||||||
|
|
||||||
|
// Modify NPC using traits after the entity has been created
|
||||||
|
for (Trait trait : getTraits())
|
||||||
|
trait.onNPCSpawn();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user