SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Announce event fights on spectate' (#325) from announceSpectate into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #325
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2022-04-01 16:01:46 +02:00
Commit 02e13f5d9e

Datei anzeigen

@ -59,23 +59,27 @@ public class EventStarter implements Runnable {
EventFight next; EventFight next;
while((next = nextFight(fights)) != null){ while((next = nextFight(fights)) != null){
if(!BungeeCore.EVENT_MODE && Event.get(next.getEventID()).spectateSystem())
break; //Don't start EventServer if not the event bungee
Team blue = Team.get(next.getTeamBlue()); Team blue = Team.get(next.getTeamBlue());
Team red = Team.get(next.getTeamRed()); Team red = Team.get(next.getTeamRed());
ServerStarter starter = new ServerStarter().event(next);
ProxiedPlayer leiter = ProxyServer.getInstance().getPlayer(SteamwarUser.get(next.getKampfleiter()).getUuid()); //Don't start EventServer if not the event bungee
if(leiter != null) if(BungeeCore.EVENT_MODE || !Event.get(next.getEventID()).spectateSystem()) {
starter.send(leiter); ServerStarter starter = new ServerStarter().event(next);
Subserver subserver = starter.start(); ProxiedPlayer leiter = ProxyServer.getInstance().getPlayer(SteamwarUser.get(next.getKampfleiter()).getUuid());
if(leiter != null)
starter.send(leiter);
eventServer.put(blue.getTeamId(), subserver); Subserver subserver = starter.start();
eventServer.put(red.getTeamId(), subserver);
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER", eventServer.put(blue.getTeamId(), subserver);
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName()); eventServer.put(red.getTeamId(), subserver);
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/event " + blue.getTeamKuerzel()), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
} else {
Message.broadcast("EVENT_FIGHT_BROADCAST", "EVENT_FIGHT_BROADCAST_HOVER",
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/spectate"), blue.getTeamColor(), blue.getTeamName(), red.getTeamColor(), red.getTeamName());
}
} }
} }