SteamWar/FightSystem
Archiviert
13
1

Merge branch 'worldconfig'

Dieser Commit ist enthalten in:
Travis CI 2019-06-14 12:54:28 +02:00
Commit 5b5e941189

Datei anzeigen

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