mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Config files generate properly on reload.
This commit is contained in:
1 parent
6aa10fca11
commit
9de009cc44
2 files changed
+20
-10
No files matched your search
@@ -65,19 +65,11 @@ public class Anticheat extends JavaPlugin
|
||||
public void onEnable()
|
||||
{
|
||||
plugin = this;
|
||||
if(!new File(this.getDataFolder()+"/config.yml").exists())
|
||||
{
|
||||
saveDefaultConfig();
|
||||
if(verbose)
|
||||
{
|
||||
logger.log(Level.INFO,"[AC] Config file created");
|
||||
}
|
||||
}
|
||||
checkConfig();
|
||||
config = AnticheatManager.CONFIGURATION;
|
||||
verbose = config.verboseStartup();
|
||||
updateFolder = config.updateFolder();
|
||||
checkForUpdate();
|
||||
|
||||
eventList.add(new PlayerListener());
|
||||
eventList.add(new BlockListener());
|
||||
eventList.add(new EntityListener());
|
||||
@@ -216,6 +208,18 @@ public class Anticheat extends JavaPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkConfig()
|
||||
{
|
||||
if(!config.getConfigFile().exists())
|
||||
{
|
||||
plugin.saveDefaultConfig();
|
||||
if(verbose)
|
||||
{
|
||||
logger.log(Level.INFO,"[AC] Config file created");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkForUpdate()
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public class Configuration {
|
||||
|
||||
public boolean alertXRay()
|
||||
{
|
||||
return logXRay;
|
||||
return alertXRay;
|
||||
}
|
||||
|
||||
public boolean autoUpdate()
|
||||
@@ -91,6 +91,7 @@ public class Configuration {
|
||||
|
||||
public final void load()
|
||||
{
|
||||
Anticheat.checkConfig();
|
||||
config = YamlConfiguration.loadConfiguration(configFile);
|
||||
bukkit = YamlConfiguration.loadConfiguration(bukkitFile);
|
||||
updateFolder = bukkit.getString("settings.update-folder");
|
||||
@@ -163,6 +164,11 @@ public class Configuration {
|
||||
return worlds;
|
||||
}
|
||||
|
||||
public File getConfigFile()
|
||||
{
|
||||
return configFile;
|
||||
}
|
||||
|
||||
public boolean checkInWorld(World world)
|
||||
{
|
||||
return worlds.contains(world.getName());
|
||||
|
||||
Reference in new issue
Block a user