mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
Update EventListen.java
This commit is contained in:
parent
6419d7a17c
commit
fef6ddc5fc
@ -216,8 +216,8 @@ public class EventListen implements Listener {
|
|||||||
if (npc == null) {
|
if (npc == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Bukkit.getPluginManager().callEvent(new NPCDeathEvent(npc, event));
|
|
||||||
final Location location = npc.getEntity().getLocation();
|
final Location location = npc.getEntity().getLocation();
|
||||||
|
Bukkit.getPluginManager().callEvent(new NPCDeathEvent(npc, event));
|
||||||
npc.despawn(DespawnReason.DEATH);
|
npc.despawn(DespawnReason.DEATH);
|
||||||
|
|
||||||
if (npc.data().has(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA)) {
|
if (npc.data().has(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA)) {
|
||||||
@ -235,7 +235,7 @@ public class EventListen implements Listener {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!npc.isSpawned()) {
|
if (!npc.isSpawned() && npc.getOwningRegistry().getByUniqueId(npc.getUniqueId()) == npc) {
|
||||||
npc.spawn(location);
|
npc.spawn(location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user