mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
fix bug
This commit is contained in:
parent
d7d3d72856
commit
dbecb5763d
@ -145,6 +145,8 @@ public class CitizensNPC implements NPC {
|
|||||||
if (spawnEvent.isCancelled()) {
|
if (spawnEvent.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spawned = true;
|
||||||
addTrait(new LocationTrait(loc));
|
addTrait(new LocationTrait(loc));
|
||||||
mcEntity = manager.spawn(this, loc);
|
mcEntity = manager.spawn(this, loc);
|
||||||
}
|
}
|
||||||
@ -158,6 +160,7 @@ public class CitizensNPC implements NPC {
|
|||||||
|
|
||||||
Bukkit.getPluginManager().callEvent(new NPCDespawnEvent(this));
|
Bukkit.getPluginManager().callEvent(new NPCDespawnEvent(this));
|
||||||
|
|
||||||
|
spawned = false;
|
||||||
mcEntity.die();
|
mcEntity.die();
|
||||||
manager.despawn(this);
|
manager.despawn(this);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user