package me.yaruma.fightsystem.fight; import me.yaruma.fightsystem.FightSystem; import org.bukkit.entity.Player; public class Fight { public static FightTeam redTeam = new FightTeam(null, FightSystem.getPlugin()); public static FightTeam blueTeam = new FightTeam(null, FightSystem.getPlugin()); public static FightTeam getPlayerTeam(Player player) { if(redTeam.isPlayerInTeam(player)) { return redTeam; } if(blueTeam.isPlayerInTeam(player)) { return blueTeam; } return null; } public static FightTeam getOpposite(FightTeam fightTeam) { if(fightTeam == redTeam) { return blueTeam; } if(fightTeam == blueTeam) { return redTeam; } return null; } public static FightTeam getInvitedTeam(Player player){ if(redTeam.getInvited().contains(player)) { return redTeam; }else if(blueTeam.getInvited().contains(player)) { return blueTeam; } return null; } public void broadcast(String message) { blueTeam.broadcast(message); redTeam.broadcast(message); } public static FightPlayer getFightPlayer(Player player) { if(redTeam.isPlayerInTeam(player)) { FightPlayer fightPlayer = redTeam.getFightPlayer(player); return fightPlayer; } if(blueTeam.isPlayerInTeam(player)) { FightPlayer fightPlayer = blueTeam.getFightPlayer(player); return fightPlayer; } return null; } public static FightTeam getRedTeam() { return redTeam; } public static FightTeam getBlueTeam() { return blueTeam; } }