Skip to content

Commit

Permalink
Update RespawnProtectionListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Sstudiosdev authored Mar 31, 2024
1 parent eb9fc92 commit a03837e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public void onPlayerDeath(PlayerDeathEvent event) {
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
final Player player = event.getPlayer();
if (!config.getBoolean("respawn-protection.enabled", true)) {
return;
}

playersWithRespawnProtection.add(player);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
playersWithRespawnProtection.remove(player);
Expand All @@ -56,4 +60,4 @@ public void onEntityDamage(EntityDamageEvent event) {
}
}
}
}
}

0 comments on commit a03837e

Please sign in to comment.