From 2fb2fbc78136a135ce8863123d3e7c0c897685ae Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 30 May 2022 11:31:15 +0200 Subject: [PATCH] Add arg to replay command for direct selection of map --- src/de/steamwar/bungeecore/commands/ReplayCommand.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ReplayCommand.java b/src/de/steamwar/bungeecore/commands/ReplayCommand.java index ac1d003..ef6e5c0 100644 --- a/src/de/steamwar/bungeecore/commands/ReplayCommand.java +++ b/src/de/steamwar/bungeecore/commands/ReplayCommand.java @@ -56,12 +56,18 @@ public class ReplayCommand extends BasicCommand { ArenaMode mode = fight.getGameMode(); 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()) { - starter.test(mode, mode.getRandomMap(), player).start(); + starter.test(mode, map, player).start(); } else if(!fight.replayAllowed()) { sender.system("REPLAY_UNAVAILABLE"); } 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(); }