Search in sources :

Example 1 with CurrentLocation

use of net.citizensnpcs.trait.CurrentLocation in project Citizens2 by CitizensDev.

the class CitizensNPC method load.

@Override
public void load(final DataKey root) {
    super.load(root);
    // Spawn the NPC
    CurrentLocation spawnLocation = getTrait(CurrentLocation.class);
    if (getTrait(Spawned.class).shouldSpawn() && spawnLocation.getLocation() != null) {
        spawn(spawnLocation.getLocation());
    }
    if (getTrait(Spawned.class).shouldSpawn() && spawnLocation.getLocation() == null) {
        Messaging.debug("Tried to spawn", getId(), "on load but world was null");
    }
    navigator.load(root.getRelative("navigator"));
}
Also used : CurrentLocation(net.citizensnpcs.trait.CurrentLocation)

Aggregations

CurrentLocation (net.citizensnpcs.trait.CurrentLocation)1