SteamWar/BungeeCore
Archiviert
13
2

Hotfix ChatListener and RankCommand die letzte
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2024-08-03 15:21:26 +02:00
Ursprung c90de5c455
Commit f5306a8ba0
3 geänderte Dateien mit 8 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -118,4 +118,9 @@ public class ArenaMode extends GameModeConfig {
return getServer().getChatNames().isEmpty(); return getServer().getChatNames().isEmpty();
} }
public String getSchemTypeOrInternalName() {
Schematic schematic = getSchematic();
if (schematic == null) return internalName;
return schematic.getType();
}
} }

Datei anzeigen

@ -48,10 +48,10 @@ public class RankCommand extends SWCommand {
if (!mode.isRanked()) if (!mode.isRanked())
continue; continue;
Optional<Integer> elo = UserElo.getElo(user.getId(), mode.getSchemType()); Optional<Integer> elo = UserElo.getElo(user.getId(), mode.getSchemTypeOrInternalName());
Message eloMsg; Message eloMsg;
if (elo.isPresent()) { if (elo.isPresent()) {
int placement = UserElo.getPlacement(elo.get(), mode.getSchemType()); int placement = UserElo.getPlacement(elo.get(), mode.getSchemTypeOrInternalName());
eloMsg = new Message("RANK_PLACED", placement, elo.get()); eloMsg = new Message("RANK_PLACED", placement, elo.get());
} else { } else {
eloMsg = new Message("RANK_UNPLACED"); eloMsg = new Message("RANK_UNPLACED");

Datei anzeigen

@ -52,10 +52,7 @@ public class ChatListener extends BasicListener {
private static final Logger cmdLogger = Logger.getLogger("Command logger"); private static final Logger cmdLogger = Logger.getLogger("Command logger");
private static final List<String> rankedModes = ArenaMode.getAllModes().stream().filter(ArenaMode::isRanked).map(arenaMode -> { private static final List<String> rankedModes = ArenaMode.getAllModes().stream().filter(ArenaMode::isRanked).map(ArenaMode::getSchemTypeOrInternalName).toList();
if (arenaMode.getSchematic() != null) return arenaMode.getSchemType();
return arenaMode.getChatName();
}).toList();
@Subscribe(order = PostOrder.FIRST) @Subscribe(order = PostOrder.FIRST)
public void fixCommands(CommandExecuteEvent e) { public void fixCommands(CommandExecuteEvent e) {