SteamWar/FightSystem
Archiviert
13
1
Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Yaruma3341 2019-07-17 18:43:21 +02:00
Ursprung a2f8b8e917
Commit 5d5884ca1b
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -2,6 +2,7 @@ package me.yaruma.fightsystem.listener;
import me.yaruma.fightsystem.FightSystem;
import me.yaruma.fightsystem.fight.Fight;
import me.yaruma.fightsystem.fight.FightPlayer;
import me.yaruma.fightsystem.fight.FightState;
import me.yaruma.fightsystem.fight.FightTeam;
import org.bukkit.Bukkit;
@ -26,8 +27,11 @@ public class PlayerQuitListener implements Listener {
if(fightState == FightState.SETUP){
fightTeam.removePlayer(player);
}else if(fightState == FightState.PRE_RUNNING || fightState == FightState.RUNNING){
fightTeam.getFightPlayer(player).setOut(true);
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §chat den Kampf verlassen!");
FightPlayer fightPlayer = fightTeam.getFightPlayer(player);
if(!fightPlayer.isOut()) {
fightTeam.getFightPlayer(player).setOut(true);
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §chat den Kampf verlassen!");
}
}
}
}

Datei anzeigen

@ -39,7 +39,8 @@ public class Scoreboard {
objective.setDisplayName(fightTeam.getName());
for (FightPlayer fp : fightTeam.getPlayers()) {
objective.getScore(fightTeam.getPrefix() + fp.getPlayer().getName()).setScore((int) fp.getPlayer().getHealth());
if(!fp.isOut())
objective.getScore(fightTeam.getPrefix() + fp.getPlayer().getName()).setScore((int) fp.getPlayer().getHealth());
}
index++;