SteamWar/BungeeCore
Archiviert
13
2

Add arg to replay command for direct selection of map
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-05-30 11:31:15 +02:00
Ursprung cb5f78a7de
Commit 2fb2fbc781

Datei anzeigen

@ -56,12 +56,18 @@ public class ReplayCommand extends BasicCommand {
ArenaMode mode = fight.getGameMode(); ArenaMode mode = fight.getGameMode();
ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(player); ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(player);
String map = mode.getRandomMap();
if (args.length > 0) {
String tMap = mode.hasMap(args[0]);
if (tMap != null) map = tMap;
}
if (user.getUserGroup().isAdminGroup() && click.isShiftClick() && fight.replayExists()) { if (user.getUserGroup().isAdminGroup() && click.isShiftClick() && fight.replayExists()) {
starter.test(mode, mode.getRandomMap(), player).start(); starter.test(mode, map, player).start();
} else if(!fight.replayAllowed()) { } else if(!fight.replayAllowed()) {
sender.system("REPLAY_UNAVAILABLE"); sender.system("REPLAY_UNAVAILABLE");
} else { } else {
starter.arena(mode, mode.getRandomMap()).start(); starter.arena(mode, map).start();
} }
}, page -> Fight.getPage(page, 45).stream().map(fight -> new SWListInv.SWListEntry<>(getFightItem(sender, fight), fight)).collect(Collectors.toList())).open(); }, page -> Fight.getPage(page, 45).stream().map(fight -> new SWListInv.SWListEntry<>(getFightItem(sender, fight), fight)).collect(Collectors.toList())).open();
} }