SteamWar/MissileWars
Archiviert
13
0

Add FightEndsPacket to end call
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2024-08-03 14:01:30 +02:00
Ursprung 76ebcc95a0
Commit b5db2a4c70

Datei anzeigen

@ -32,7 +32,9 @@ import de.steamwar.misslewars.listener.*;
import de.steamwar.misslewars.listener.special.BarrierListener;
import de.steamwar.misslewars.listener.special.SpaceListener;
import de.steamwar.misslewars.slowmo.SlowMoRunner;
import de.steamwar.network.NetworkSender;
import de.steamwar.network.packets.common.FightEndsPacket;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.*;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@ -147,9 +149,20 @@ public class MissileWars extends JavaPlugin {
player.setGameMode(GameMode.SPECTATOR);
}
// TODO: FightsEndPacket for ELO...
byte ergebnis = winner == blueTeam ? (byte) 1 : (byte) 2;
if (Config.isEvent()) {
Config.EventKampf.setErgebnis(winner == blueTeam ? 1 : 2);
Config.EventKampf.setErgebnis(ergebnis);
} else {
FightEndsPacket packet = FightEndsPacket.builder()
.gameMode("MissileWars")
.duration((int)((System.currentTimeMillis() - FightScoreboard.getStartTime()) / 1000))
.win(ergebnis)
.bluePlayers(blueTeam.getPlayers().stream().map(Player::getUniqueId).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()))
.redPlayers(redTeam.getPlayers().stream().map(Player::getUniqueId).map(SteamwarUser::get).map(SteamwarUser::getId).collect(Collectors.toList()))
.blueSchem(-1)
.redSchem(-1)
.build();
NetworkSender.send(packet);
}
switch (reason) {