Kill players who log out during raids and force respawn players who die in raids

This commit is contained in:
AlexTheCoder 2017-07-14 06:31:45 -04:00
parent 460cc29c04
commit 82679aae8a

View File

@ -251,7 +251,8 @@ public abstract class RaidWorldEvent extends WorldEvent
} }
if (_players.remove(event.getPlayer())) if (_players.remove(event.getPlayer()))
{ {
event.getPlayer().teleport(Spawn.getNorthSpawn()); event.getPlayer().setHealth(0);
event.getPlayer().spigot().respawn();
} }
} }
@ -264,13 +265,7 @@ public abstract class RaidWorldEvent extends WorldEvent
} }
if (_players.remove(event.getEntity())) if (_players.remove(event.getEntity()))
{ {
event.getEntity().setHealth(event.getEntity().getMaxHealth()); Manager.runSyncLater(() -> event.getEntity().spigot().respawn(), 10);
getCondition().Clean(event.getEntity());
event.getEntity().getActivePotionEffects().forEach(pe -> event.getEntity().removePotionEffect(pe.getType()));
event.getEntity().setExp(0);
event.getEntity().setLevel(0);
event.getEntity().setFireTicks(-1);
event.getEntity().teleport(Spawn.getNorthSpawn());
} }
} }