Hotfix ChatListener and RankCommand die letzte
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
c90de5c455
Commit
f5306a8ba0
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
|
@ -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) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren