use of pl.themolka.arcade.settings.SettingsReloadEvent in project Arcade2 by ShootGame.
the class ArcadeCommands method reload.
//
// '/arcade reload' command
//
private void reload(Sender sender) {
if (!sender.hasPermission("arcade.command.reload")) {
throw new CommandPermissionException("arcade.command.reload");
}
Settings settings = this.plugin.getSettings();
sender.sendInfo("Reloading settings file...");
try {
settings.setDocument(settings.readSettingsFile());
this.plugin.getEventBus().publish(new SettingsReloadEvent(this.plugin, settings));
sender.sendSuccess("Successfully reloaded settings file. Well done!");
} catch (DOMException | IOException | ParserNotSupportedException ex) {
ex.printStackTrace();
throw new CommandException("Could not reload settings file: " + ex.getMessage());
}
}
use of pl.themolka.arcade.settings.SettingsReloadEvent in project Arcade2 by ShootGame.
the class ArcadePlugin method reloadConfig.
@Override
public void reloadConfig() {
try {
this.settings.setDocument(this.settings.readSettingsFile());
this.getEventBus().publish(new SettingsReloadEvent(this, this.settings));
} catch (DOMException | IOException | ParserNotSupportedException ex) {
throw new RuntimeException(ex);
}
}
Aggregations