forked from fzorb/noThankYouMicrosoft
add reReadDatabase()
This commit is contained in:
parent
a054eb096e
commit
45c2770873
1 changed files with 11 additions and 1 deletions
|
@ -22,7 +22,7 @@ public final class NoThankYouMicrosoft extends JavaPlugin {
|
|||
this.getServer().getPluginManager().registerEvents(new messageListener(), this);
|
||||
}
|
||||
|
||||
public void createDatabaseConfig() {
|
||||
private void createDatabaseConfig() {
|
||||
databaseFile = new File(getDataFolder(), "database.yml");
|
||||
if (!databaseFile.exists()) {
|
||||
databaseFile.getParentFile().mkdirs();
|
||||
|
@ -37,6 +37,16 @@ public final class NoThankYouMicrosoft extends JavaPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
public void reReadDatabase() {
|
||||
databaseFile = new File(getDataFolder(), "database.yml");
|
||||
databaseFileConfig = new YamlConfiguration();
|
||||
try {
|
||||
databaseFileConfig.load(databaseFile);
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static JavaPlugin getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue