From 0027c6c69ba20981e2b271043a66152f0184779d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 4 Feb 2021 09:16:22 +0100 Subject: [PATCH] Configurable world config Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/Config.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FightSystem_API/src/de/steamwar/fightsystem/Config.java b/FightSystem_API/src/de/steamwar/fightsystem/Config.java index 3e05939..d3f955d 100644 --- a/FightSystem_API/src/de/steamwar/fightsystem/Config.java +++ b/FightSystem_API/src/de/steamwar/fightsystem/Config.java @@ -151,18 +151,18 @@ public class Config { public static final int spectatePort = 2222; static{ - File worldConfigFile = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "config.yml"); - if(!worldConfigFile.exists()) { - Bukkit.getLogger().log(Level.SEVERE, "Weltconfig fehlt!"); - IFightSystem.shutdown(null); - } - if(!new File(IFightSystem.getPlugin().getDataFolder(), System.getProperty("config", "config.yml")).exists()) { IFightSystem.getPlugin().saveDefaultConfig(); Bukkit.getLogger().log(Level.SEVERE, "Arenaconfig fehlt!"); IFightSystem.shutdown(null); } FileConfiguration config = IFightSystem.getPlugin().getConfig(); + + File worldConfigFile = new File(Bukkit.getWorlds().get(0).getWorldFolder(), config.getString("Arenaconfig", "config.yml")); + if(!worldConfigFile.exists()) { + Bukkit.getLogger().log(Level.SEVERE, "Weltconfig fehlt!"); + IFightSystem.shutdown(null); + } FileConfiguration worldconfig = YamlConfiguration.loadConfiguration(worldConfigFile); NoPlayerOnlineDuration = config.getInt("Times.NoPlayersOnlineDuration");