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