mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-01 14:08:08 +01:00
Moving the spawn call was ill-advised
This commit is contained in:
parent
5f6014d87d
commit
9a6bdaa170
@ -89,14 +89,6 @@ public abstract class CitizensNPC extends AbstractNPC {
|
||||
}
|
||||
|
||||
public void load(final DataKey root) {
|
||||
// Spawn the NPC
|
||||
Spawned spawned = getTrait(Spawned.class);
|
||||
CurrentLocation spawnLocation = getTrait(CurrentLocation.class);
|
||||
loadTrait(spawned, root.getRelative("traits.spawned"));
|
||||
loadTrait(spawnLocation, root.getRelative("traits.location"));
|
||||
if (spawned.shouldSpawn() && spawnLocation.getLocation() != null)
|
||||
spawn(spawnLocation.getLocation());
|
||||
|
||||
metadata.loadFrom(root.getRelative("metadata"));
|
||||
// Load traits
|
||||
|
||||
@ -126,6 +118,11 @@ public abstract class CitizensNPC extends AbstractNPC {
|
||||
loadTrait(trait, traitKey);
|
||||
}
|
||||
|
||||
// Spawn the NPC
|
||||
CurrentLocation spawnLocation = getTrait(CurrentLocation.class);
|
||||
if (getTrait(Spawned.class).shouldSpawn() && spawnLocation.getLocation() != null)
|
||||
spawn(spawnLocation.getLocation());
|
||||
|
||||
navigator.load(root.getRelative("navigator"));
|
||||
}
|
||||
|
||||
|
@ -193,10 +193,6 @@ public class LinearWaypointProvider implements WaypointProvider {
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (npc == null) {
|
||||
end();
|
||||
return;
|
||||
}
|
||||
if (!event.getPlayer().equals(player) || event.getAction() == Action.PHYSICAL)
|
||||
return;
|
||||
if (event.getPlayer().getWorld() != npc.getBukkitEntity().getWorld())
|
||||
|
Loading…
Reference in New Issue
Block a user