Team Event API, Fancy Borders #413
@ -28,6 +28,7 @@ import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightPlayer;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.OneShotStateDependent;
|
||||
import de.steamwar.fightsystem.states.StateDependentListener;
|
||||
import de.steamwar.fightsystem.states.StateDependentTask;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -53,6 +54,7 @@ public class TeamArea implements Listener {
|
||||
|
||||
new StateDependentListener(ArenaMode.AntiTest, FightState.All, this);
|
||||
new StateDependentTask(ArenaMode.AntiTest, FightState.TeamFix, this::realSpectatorCheck, 1, 1);
|
||||
new OneShotStateDependent(ArenaMode.AntiTest, FightState.Spectate, () -> Fight.teams().forEach(t -> t.getPlayers().forEach(this::teamSpectator)));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -85,7 +87,10 @@ public class TeamArea implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void teamDeath(TeamDeathEvent e) {
|
||||
FightPlayer fightPlayer = e.getFightPlayer();
|
||||
teamSpectator(e.getFightPlayer());
|
||||
}
|
||||
|
||||
private void teamSpectator(FightPlayer fightPlayer) {
|
||||
if(fightPlayer.getTeam() == team) {
|
||||
fightPlayer.ifPlayer(bordingBorder::removePlayer);
|
||||
} else {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren