本文整理汇总了Java中net.cubespace.Yamler.Config.InvalidConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidConfigurationException类的具体用法?Java InvalidConfigurationException怎么用?Java InvalidConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidConfigurationException类属于net.cubespace.Yamler.Config包,在下文中一共展示了InvalidConfigurationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadConfigs
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
private void loadConfigs() {
// config.yml
try {
File file = new File(getDataFolder(), "config.yml");
conf = new Config(file);
conf.init();
if (!conf.version.equalsIgnoreCase(getDescription().getVersion())) {
file.delete();
conf.init();
}
} catch (InvalidConfigurationException ex) {
log.error("Could not load config.yml file - Please check for errors", ex);
}
}
示例2: remove
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
* Remove void.
*
* @param uuid the uuid of the player to remove
* @return the true if the element was successfully removed
* @throws RuntimeException if the player was unable to be removed
*/
public boolean remove(UUID uuid) throws RuntimeException {
if (isLoaded(uuid)) {
try {
loadedPlayers.get(uuid.toString()).save();
loadedPlayers.remove(uuid.toString());
plugin.getLogger().info("Successfully removed from loaded players PlayerDatabase with uuid " + uuid.toString());
return true;
} catch (InvalidConfigurationException e) {
throw new RuntimeException(e);
}
}
return false;
}
示例3: removeAll
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
* Remove all players from the Player Store, saving each player before hand, best used in plugins on disable method.
*/
public void removeAll() {
for (Map.Entry<String, PlayerData> player : loadedPlayers.entrySet()) {
try {
player.getValue().save();
loadedPlayers.remove(player.getKey());
plugin.getLogger().info("Successfully removed from loaded players PlayerDatabase with name " + player.getValue().getName());
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
}
plugin.getLogger().info("All player successfully saved and removed from PlayerStore");
}
示例4: WorldManager
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public WorldManager() {
this.config = new WorldConfig( new File( "config" ) );
try {
this.config.init();
} catch ( InvalidConfigurationException e ) {
e.printStackTrace();
}
}
示例5: LibraryManager
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public LibraryManager() {
this.folder = new File( "libs" );
if ( !this.folder.exists() ) {
this.folder.mkdir();
}
this.config = new LibraryConfig( new File( this.folder, "libraries.yml" ) );
try {
this.config.init();
} catch ( InvalidConfigurationException e ) {
e.printStackTrace();
}
}
示例6: init
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public void init() {
System.out.println( "Loading libraries, please wait..." );
for ( Library library : this.config.getLibraryList() ) {
loadLibrary( library );
}
try {
config.save();
} catch ( InvalidConfigurationException e ) {
e.printStackTrace();
}
}
示例7: onDisable
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
public void onDisable()
{
if (yamlConf != null) {
if (yamlConf.enableSQL) {
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
if (Thirst.getInstance().getYAMLConfig().displayType.equalsIgnoreCase("SCOREBOARD"))
player.setScoreboard(Bukkit.getServer().getScoreboardManager().getNewScoreboard());
//Gotta run sync bc Bukkit gets mad if you try schedule new tasks when it's disabling ;-;
UtilSQL.getInstance().runStatementSync("UPDATE TABLENAME SET thirst = " + ThirstManager.getThirst().getPlayerThirst(player) + " WHERE uuid = '" + player.getUniqueId().toString() + "'");
}
} else {
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
if (Thirst.getInstance().getYAMLConfig().displayType.equalsIgnoreCase("SCOREBOARD"))
p.setScoreboard(Bukkit.getServer().getScoreboardManager().getNewScoreboard());
DataConfig.getConfig().writeThirstToFile(p.getUniqueId(), ThirstManager.getThirst().getPlayerThirst(p));
}
DataConfig.getConfig().saveFile();
}
try {
yamlConf.reload();
yamlConf.save();
} catch (InvalidConfigurationException ex) {
printError(ex, "Error while saving the config.yml file please check that you didn't use tabs and all formatting is correct.");
}
}
}
示例8: init
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
public void init() {
try {
super.init();
} catch (InvalidConfigurationException e) {
throw Throwables.propagate(e);
}
}
示例9: init
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
@Synchronized("lock")
public void init() {
Utils.assertMainThread();
try {
super.init();
} catch (InvalidConfigurationException e) {
throw Throwables.propagate(e);
}
}
示例10: load
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
@Synchronized("lock")
public void load() {
Utils.assertMainThread();
try {
super.load();
} catch (InvalidConfigurationException e) {
throw Throwables.propagate(e);
}
}
示例11: save
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
@Synchronized("lock")
public void save() {
Utils.assertMainThread();
try {
super.save();
} catch (InvalidConfigurationException e) {
throw Throwables.propagate(e);
}
}
示例12: Configuration
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public Configuration(){
CONFIG_HEADER = new String[]{"Bungee Admin Tools - Configuration file"};
CONFIG_FILE = new File(BAT.getInstance().getDataFolder(), "config.yml");
try {
init();
save();
} catch (final InvalidConfigurationException e) {
e.printStackTrace();
}
}
示例13: init
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public void init(final String moduleName){
try {
initThrowingExceptions(moduleName);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
}
示例14: initThrowingExceptions
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
* Unlike {@link ModuleConfiguration#init()} this init method throw the exception and doesn't
* print it in the console
*/
public void initThrowingExceptions(final String moduleName) throws InvalidConfigurationException{
CONFIG_HEADER = new String[] { "BungeeAdminTools - " + moduleName + " configuration file" };
CONFIG_FILE = new File(BAT.getInstance().getDataFolder(), moduleName + ".yml");
init();
load();
}
示例15: onCommand
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
public void onCommand(final CommandSender sender, final String[] args, final boolean confirmedCmd)
throws IllegalArgumentException {
sender.sendMessage(BAT.__("Starting reload ..."));
try {
BAT.getInstance().getConfiguration().reload();
} catch (InvalidConfigurationException e) {
BAT.getInstance().getLogger().severe("Error during reload of main configuration :");
e.printStackTrace();
}
I18n.reload();
BAT.getInstance().getModules().unloadModules();
BAT.getInstance().getModules().loadModules();
sender.sendMessage(BAT.__("Reload successfully executed ..."));
}