mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
b
This commit is contained in:
parent
a2f7394c88
commit
072879ad33
@ -47,7 +47,7 @@ public class Plex extends JavaPlugin
|
||||
{
|
||||
plugin = this;
|
||||
|
||||
config = new MainConfig(this, "config.yml");
|
||||
config = new MainConfig(this);
|
||||
|
||||
saveResource("database.db", false);
|
||||
|
||||
@ -67,18 +67,18 @@ public class Plex extends JavaPlugin
|
||||
public void onEnable()
|
||||
{
|
||||
config.load();
|
||||
PlexLog.log("Loaded config.yml");
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
PlexUtils.testConnections();
|
||||
PlexLog.log("Connected to " + storageType.name().toUpperCase());
|
||||
} catch (Exception e)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
PlexLog.error("Failed to connect to " + storageType.name().toUpperCase());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
if (storageType == StorageType.MONGO)
|
||||
{
|
||||
mongoPlayerData = new MongoPlayerData();
|
||||
@ -95,7 +95,6 @@ public class Plex extends JavaPlugin
|
||||
rankManager.generateDefaultRanks();
|
||||
rankManager.importDefaultRanks();
|
||||
PlexLog.log("Rank Manager initialized");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,14 +10,14 @@ public class MainConfig extends YamlConfiguration
|
||||
private final Plex plugin;
|
||||
private final File file;
|
||||
|
||||
public MainConfig(Plex plugin, String configName)
|
||||
public MainConfig(Plex plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
this.file = new File(plugin.getDataFolder(), configName);
|
||||
this.file = new File(plugin.getDataFolder(), "config.yml");
|
||||
|
||||
if (!file.exists())
|
||||
{
|
||||
saveDefault(configName);
|
||||
saveDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,8 +45,8 @@ public class MainConfig extends YamlConfiguration
|
||||
}
|
||||
}
|
||||
|
||||
private void saveDefault(String configName)
|
||||
private void saveDefault()
|
||||
{
|
||||
plugin.saveResource(configName, false);
|
||||
plugin.saveResource("config.yml", false);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user