SteamWar/BungeeCore
Archiviert
13
2

Update ReplayCommand #398

Zusammengeführt
Lixfel hat 1 Commits von CommandReplay nach master 2022-06-16 13:24:09 +02:00 zusammengeführt
Nur Änderungen aus Commit 279577a536 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -27,6 +27,7 @@ import de.steamwar.bungeecore.sql.Fight;
import de.steamwar.bungeecore.sql.Punishment;
import de.steamwar.bungeecore.sql.SchematicType;
import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.command.SWCommand;
import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -35,18 +36,14 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class ReplayCommand extends BasicCommand {
public class ReplayCommand extends SWCommand {
public ReplayCommand() {
super("replay", null);
super("replay");
}
@Override
public void execute(CommandSender s, String[] args) {
if(!(s instanceof ProxiedPlayer))
return;
ProxiedPlayer player = (ProxiedPlayer) s;
@Register
public void genericCommand(ProxiedPlayer player, @OptionalValue("") String optionalMap) {
ChatSender sender = ChatSender.of(player);
if (sender.user().isPunishedWithMessage(sender, Punishment.PunishmentType.NoFightServer))
return;
@ -57,8 +54,8 @@ public class ReplayCommand extends BasicCommand {
ServerStarter starter = new ServerStarter().replay(fight.getFightID()).blueLeader(player);
String map = mode.getRandomMap();
if (args.length > 0) {
String tMap = mode.hasMap(args[0]);
if (!optionalMap.equals("")) {
String tMap = mode.hasMap(optionalMap);
if (tMap != null) map = tMap;
}