SteamWar/BungeeCore
Archiviert
13
2

Adjust config for new fight system #192

Manuell gemergt
Lixfel hat 6 Commits von newFightSystem nach master 2021-03-31 20:07:01 +02:00 zusammengeführt
2 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen
Nur Änderungen aus Commit a079b25c14 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -73,22 +73,29 @@ public class ArenaMode {
private final String internalName;
private final String displayName;
private final String folder;
private final List<String> chatNames;
private final String serverJar;
private final List<String> maps;
private final boolean historic;
private final boolean ranked;
private final String schemType;
private ArenaMode(String internalName, Configuration config){
this.internalName = internalName;
this.displayName = config.getString("displayName");
this.folder = config.getString("folder");
this.serverJar = config.getString("serverJar");
this.chatNames = config.getStringList("chatNames");
this.maps = config.getStringList("maps");
this.displayName = config.getString("displayName", internalName);
if(config.contains("chatNames"))
this.chatNames = config.getStringList("chatNames");
else
this.chatNames = Collections.emptyList();
this.historic = config.getBoolean("historic", false);
this.schemType = config.getString("schemType", "").toLowerCase();
this.ranked = config.getBoolean("ranked", false);
this.schemType = config.getString("schemType", null);
allModes.add(this);
byInternal.put(internalName, this);
@ -96,8 +103,8 @@ public class ArenaMode {
byChat.put(name.toLowerCase(), this);
}
if(config.contains("checkSchemType"))
byCheckSchemType.put(config.getString("checkSchemType").toLowerCase(), this);
if(!this.schemType.equals(""))
byCheckSchemType.put(this.schemType, this);
}
public String getInternalName() {
@ -120,6 +127,10 @@ public class ArenaMode {
return null;
}
public String getFolder() {
return folder;
}
public String getRandomMap(){
return maps.get(random.nextInt(maps.size()));
}

Datei anzeigen

@ -108,7 +108,7 @@ public class SubserverSystem {
//Copy world
try {
new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getInternalName() + "/" + map, worldDir + mapName).start().waitFor();
new ProcessBuilder("cp", "-r", SERVER_PATH + modus.getFolder() + "/" + map, worldDir + mapName).start().waitFor();
} catch (IOException | InterruptedException e) {
throw new SecurityException("Could not copy folder", e);
}