mirror of
https://github.com/taoneill/war.git
synced 2025-01-03 06:17:33 +01:00
When using respawn timer, lock players in spawn with potions
This commit is contained in:
parent
d3b5795dda
commit
994fec5a14
@ -42,6 +42,7 @@ import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.permissions.Permissible;
|
||||
import org.bukkit.permissions.PermissionAttachment;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
@ -515,6 +516,14 @@ public class Warzone {
|
||||
new Object[] {potionEffect, name});
|
||||
}
|
||||
}
|
||||
|
||||
int respawnTime = team.getTeamConfig().resolveInt(TeamConfig.RESPAWNTIMER) * 20;
|
||||
if (respawnTime > 0) {
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, respawnTime, 255));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, respawnTime, 200));
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, respawnTime, 255));
|
||||
player.sendTitle("", ChatColor.RED + "Respawning in " + respawnTime / 20 + " seconds...", 1, respawnTime, 10);
|
||||
}
|
||||
|
||||
boolean isFirstRespawn = false;
|
||||
if (!this.getLoadoutSelections().keySet().contains(player.getName())) {
|
||||
|
Loading…
Reference in New Issue
Block a user