Fail on DC

This commit is contained in:
Mathieu Strypsteen 2024-09-23 08:19:37 +02:00
parent 2579ab220e
commit b0e52ca41f

View file

@ -11,6 +11,8 @@ import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import org.bukkit.scoreboard.Team; import org.bukkit.scoreboard.Team;
@ -82,6 +84,13 @@ public class LightningEvent extends Event {
} }
} }
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
if (MC13DTL.board.getPlayers(team).contains(event.getPlayer())) {
eventFailed();
}
}
@Override @Override
protected String getMessage() { protected String getMessage() {
return "Survive the night while staying outdoors (you need to have direct sky light above you at all times)"; return "Survive the night while staying outdoors (you need to have direct sky light above you at all times)";