mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Reload all configs on chatreload, fixes #30
This commit is contained in:
1 parent
16b68e6d1c
commit
e7cefca561
1 file changed
+18
-15
@@ -60,21 +60,8 @@ public final class CarbonChat extends JavaPlugin {
|
||||
saveResource("language.yml", false);
|
||||
}
|
||||
|
||||
modConfig = new YamlConfiguration();
|
||||
|
||||
try {
|
||||
modConfig.load(new File(getDataFolder(), "moderation.yml"));
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
languageConfig = new YamlConfiguration();
|
||||
|
||||
try {
|
||||
languageConfig.load(new File(getDataFolder(), "language.yml"));
|
||||
} catch (IOException | InvalidConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
loadModConfig();
|
||||
loadLanguage();
|
||||
|
||||
// Setup Adventure
|
||||
adventureManager = new AdventureManager(this);
|
||||
@@ -157,6 +144,22 @@ public final class CarbonChat extends JavaPlugin {
|
||||
pluginManager.registerEvents(new ShadowMuteHandler(this), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
super.reloadConfig();
|
||||
|
||||
loadModConfig();
|
||||
loadLanguage();
|
||||
}
|
||||
|
||||
private void loadModConfig() {
|
||||
modConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "moderation.yml"));
|
||||
}
|
||||
|
||||
private void loadLanguage() {
|
||||
languageConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "language.yml"));
|
||||
}
|
||||
|
||||
private void registerContexts() {
|
||||
getContextManager().register("distance", new DistanceContext());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user