Archiviert
1
0

Adjust config for new fight system

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2021-03-30 19:08:09 +02:00
Ursprung 2301a618eb
Commit a079b25c14
2 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen

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);
}