当前位置: 首页>>代码示例>>Java>>正文


Java InvalidConfigurationException类代码示例

本文整理汇总了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);
    }

}
 
开发者ID:Tom7653,项目名称:DeprecatedNametags,代码行数:17,代码来源:Nametags.java

示例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;
}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:24,代码来源:PlayerManager.java

示例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");
}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:19,代码来源:PlayerManager.java

示例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();
    }
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:9,代码来源:WorldManager.java

示例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();
        }

    }
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:16,代码来源:LibraryManager.java

示例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();
    }
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:12,代码来源:LibraryManager.java

示例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.");
		}
	}
}
 
开发者ID:GamerKing195,项目名称:Thirst,代码行数:32,代码来源:Thirst.java

示例8: init

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
@Override
public void init() {
    try {
        super.init();
    } catch (InvalidConfigurationException e) {
        throw Throwables.propagate(e);
    }
}
 
开发者ID:TechzoneMC,项目名称:SpawnShield,代码行数:9,代码来源:SpawnShieldMessages.java

示例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);
    }
}
 
开发者ID:TechzoneMC,项目名称:SpawnShield,代码行数:11,代码来源:SpawnShieldConfig.java

示例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);
    }
}
 
开发者ID:TechzoneMC,项目名称:SpawnShield,代码行数:11,代码来源:SpawnShieldConfig.java

示例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);
    }
}
 
开发者ID:TechzoneMC,项目名称:SpawnShield,代码行数:11,代码来源:SpawnShieldConfig.java

示例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();
	}
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:11,代码来源:Configuration.java

示例13: init

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public void init(final String moduleName){
      try {
       initThrowingExceptions(moduleName);
       } catch (InvalidConfigurationException e) {
           e.printStackTrace();
       }
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:8,代码来源:ModuleConfiguration.java

示例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();
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:11,代码来源:ModuleConfiguration.java

示例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 ..."));
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:16,代码来源:CoreCommand.java


注:本文中的net.cubespace.Yamler.Config.InvalidConfigurationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。