Fix fire never going out

This commit is contained in:
Connor Monahan 2017-07-28 02:08:32 -05:00
parent 57d29f464c
commit 0f09410c66

View File

@ -480,7 +480,8 @@ public class Warzone {
player.setExhaustion(0); player.setExhaustion(0);
player.setFallDistance(0); player.setFallDistance(0);
player.setFireTicks(0); player.setFireTicks(0);
War.war.getServer().getScheduler().runTaskLater(War.war, new Runnable() { player.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 5, 255));
Runnable antiFireAction = new Runnable() {
@Override @Override
public void run() { public void run() {
@ -488,7 +489,13 @@ public class Warzone {
player.setFireTicks(0); player.setFireTicks(0);
} }
}, 1L); };
// ughhhhh bukkit
War.war.getServer().getScheduler().runTaskLater(War.war, antiFireAction, 1L);
War.war.getServer().getScheduler().runTaskLater(War.war, antiFireAction, 2L);
War.war.getServer().getScheduler().runTaskLater(War.war, antiFireAction, 3L);
War.war.getServer().getScheduler().runTaskLater(War.war, antiFireAction, 4L);
War.war.getServer().getScheduler().runTaskLater(War.war, antiFireAction, 5L);
player.setLevel(0); player.setLevel(0);
@ -517,12 +524,13 @@ public class Warzone {
} }
} }
int respawnTime = team.getTeamConfig().resolveInt(TeamConfig.RESPAWNTIMER) * 20; int respawnTime = team.getTeamConfig().resolveInt(TeamConfig.RESPAWNTIMER);
if (respawnTime > 0) { int respawnTimeTicks = respawnTime * 20;
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, respawnTime, 255)); if (respawnTimeTicks > 0) {
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, respawnTime, 200)); player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, respawnTimeTicks, 255));
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, respawnTime, 255)); player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, respawnTimeTicks, 200));
player.sendTitle("", ChatColor.RED + "Respawning in " + respawnTime / 20 + " seconds...", 1, respawnTime, 10); player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, respawnTimeTicks, 255));
player.sendTitle("", ChatColor.RED + MessageFormat.format(War.war.getString("zone.spawn.timer.title"), respawnTime), 1, respawnTimeTicks, 10);
} }
boolean isFirstRespawn = false; boolean isFirstRespawn = false;