SteamWar/FightSystem
Archiviert
13
1

Not stable version

Signed-off-by: Yaruma3341 <yaruma3341@gmail.com>
Dieser Commit ist enthalten in:
Yaruma3341 2019-02-23 13:33:50 +01:00
Ursprung a6019bdbdb
Commit 6264f21fca
2 geänderte Dateien mit 7 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -56,15 +56,15 @@ public class FightTeam {
}
public boolean isPlayerInTeam(Player player) {
for(FightPlayer fightPlayer : this.players) {
if(!fightPlayer.getPlayer().equals(player)) continue;
return true;
}
if(this.leader.getPlayer() == null) return false;
if(this.leader.getPlayer().equals(player)) {
return true;
}
for(FightPlayer fightPlayer : this.players) {
if(!fightPlayer.getPlayer().equals(player)) continue;
return true;
}
return false;
}

Datei anzeigen

@ -33,11 +33,14 @@ public class PlayerJoinListener implements Listener {
if(!Fight.getRedTeam().hasTeamLeader()) {
Fight.getRedTeam().setLeader(new FightPlayer(player, false));
player.setGameMode(GameMode.ADVENTURE);
Bukkit.broadcastMessage("ADVENTURE 36");
} else if(!Fight.getBlueTeam().hasTeamLeader()) {
Fight.getBlueTeam().setLeader(new FightPlayer(player, false));
player.setGameMode(GameMode.ADVENTURE);
Bukkit.broadcastMessage("ADVENTURE 39");
} else {
player.setGameMode(GameMode.SPECTATOR);
Bukkit.broadcastMessage("SPECTATOR 42");
player.teleport(instance.getSpecSpawnLoc());
}
}