SteamWar/FightSystem
Archiviert
13
1
Dieses Repository wurde am 2024-08-05 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
FightSystem/src/me/yaruma/fightsystem/fight/Fight.java

52 Zeilen
1.4 KiB
Java

package me.yaruma.fightsystem.fight;
import me.yaruma.fightsystem.FightSystem;
import org.bukkit.entity.Player;
public class Fight {
public static final FightTeam redTeam = new FightTeam(null, FightSystem.getPlugin());
public static final FightTeam blueTeam = new FightTeam(null, FightSystem.getPlugin());
public static FightTeam getPlayerTeam(Player player) {
2019-02-23 16:07:31 +01:00
if(redTeam.isPlayerInTeam(player))
return redTeam;
2019-02-23 16:07:31 +01:00
if(blueTeam.isPlayerInTeam(player))
return blueTeam;
return null;
}
public static FightTeam getOpposite(FightTeam fightTeam) {
2019-02-23 16:07:31 +01:00
if(fightTeam == redTeam)
return blueTeam;
2019-02-23 16:07:31 +01:00
if(fightTeam == blueTeam)
return redTeam;
return null;
}
public static FightTeam getInvitedTeam(Player player){
2019-02-23 16:07:31 +01:00
if(redTeam.getInvited().contains(player))
return redTeam;
2019-02-23 16:07:31 +01:00
else if(blueTeam.getInvited().contains(player))
return blueTeam;
return null;
}
public static FightPlayer getFightPlayer(Player player) {
2019-02-23 16:07:31 +01:00
if(redTeam.isPlayerInTeam(player))
return redTeam.getFightPlayer(player);
if(blueTeam.isPlayerInTeam(player))
return blueTeam.getFightPlayer(player);
return null;
}
public static FightTeam getRedTeam() {
return redTeam;
}
public static FightTeam getBlueTeam() {
return blueTeam;
}
}