SteamWar/FightSystem
Archiviert
13
1

WIP: split up config #13

Manuell gemergt
Lixfel hat 2 Commits von worldconfig nach master 2019-06-14 12:54:41 +02:00 zusammengeführt
Nur Änderungen aus Commit e626bf5ab0 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.util.List;
@ -84,31 +85,36 @@ public class Config {
public static int ObfuscateWith;
public static void load(){
if(!new File("plugins/" + FightSystem.getPlugin().getName() + "/config.yml").exists()) {
if(!new File(Bukkit.getWorldContainer().getPath() + Bukkit.getWorlds().get(0) + "/config.yml").exists()) {
FightSystem.getPlugin().saveDefaultConfig();
System.out.println(FightSystem.PREFIX + "config.yml erstellt und geladen!");
Bukkit.shutdown();
}
if(!new File("plugins/" + FightSystem.getPlugin().getName() + "/config.yml").exists()) {
System.out.println(FightSystem.PREFIX + "config.yml fehlt!");
Bukkit.shutdown();
}
FileConfiguration config = FightSystem.getPlugin().getConfig();
YamlConfiguration worldconfig = YamlConfiguration.loadConfiguration(new File("plugins/" + FightSystem.getPlugin().getName() + "/config.yml"));
NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");
SetupDuration = config.getInt("Times.SetupDuration");
PreFightDuration = config.getInt("Times.PreFightDuration");
SpectatorDuration = config.getInt("Times.SpectatorDuration");
SchemsizeX = config.getInt("Arena.Schemsize.x");
SchemsizeY = config.getInt("Arena.Schemsize.y");
SchemsizeZ = config.getInt("Arena.Schemsize.z");
TeamBlueCornerX = config.getInt("Arena.TeamBlueCorner.x");
TeamBlueCornerY = config.getInt("Arena.TeamBlueCorner.y");
TeamBlueCornerZ = config.getInt("Arena.TeamBlueCorner.z");
TeamBluetoReddistanceX = config.getInt("Arena.TeamBluetoReddistance.x");
TeamBluetoReddistanceY = config.getInt("Arena.TeamBluetoReddistance.y");
TeamBluetoReddistanceZ = config.getInt("Arena.TeamBluetoReddistance.z");
Schem2BorderX = config.getInt("Arena.Schem2Border.x");
Schem2BorderZ = config.getInt("Arena.Schem2Border.z");
underArenaBorder = config.getInt("Arena.underArenaBorder");
BorderFromSchematic = config.getInt("Arena.BorderFromSchematic");
SchemsizeX = worldconfig.getInt("Arena.Schemsize.x");
SchemsizeY = worldconfig.getInt("Arena.Schemsize.y");
SchemsizeZ = worldconfig.getInt("Arena.Schemsize.z");
TeamBlueCornerX = worldconfig.getInt("Arena.TeamBlueCorner.x");
TeamBlueCornerY = worldconfig.getInt("Arena.TeamBlueCorner.y");
TeamBlueCornerZ = worldconfig.getInt("Arena.TeamBlueCorner.z");
TeamBluetoReddistanceX = worldconfig.getInt("Arena.TeamBluetoReddistance.x");
TeamBluetoReddistanceY = worldconfig.getInt("Arena.TeamBluetoReddistance.y");
TeamBluetoReddistanceZ = worldconfig.getInt("Arena.TeamBluetoReddistance.z");
Schem2BorderX = worldconfig.getInt("Arena.Schem2Border.x");
Schem2BorderZ = worldconfig.getInt("Arena.Schem2Border.z");
underArenaBorder = worldconfig.getInt("Arena.underArenaBorder");
BorderFromSchematic = worldconfig.getInt("Arena.BorderFromSchematic");
OnlyPublicSchematics = config.getBoolean("Schematic.OnlyPublicSchematics");
SchematicDirectory = config.getString("Schematic.Directory");