• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InvalidConfigurationException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.cubespace.Yamler.Config.InvalidConfigurationException的典型用法代码示例。如果您正苦于以下问题:Java InvalidConfigurationException类的具体用法?Java InvalidConfigurationException怎么用?Java InvalidConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InvalidConfigurationException类属于net.cubespace.Yamler.Config包,在下文中一共展示了InvalidConfigurationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: loadModules

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public void loadModules() {
	// The core module MUST NOT be disabled.
	modules.put(new Core(), IModule.OFF_STATE);
	modules.put(new Ban(), IModule.OFF_STATE);
	modules.put(new Mute(), IModule.OFF_STATE);
	modules.put(new Kick(), IModule.OFF_STATE);
	modules.put(new Comment(), IModule.OFF_STATE);
	cmdsModules = new HashMap<String, IModule>();
	for (final IModule module : modules.keySet()) {
		// The core doesn't have settings to enable or disable it
		if (!module.getName().equals("core")) {
			final Boolean isEnabled = module.getConfig().isEnabled();
			if (isEnabled == null || !isEnabled) {
				continue;
			}
		}
		if (module.load()) {
			modulesNames.put(module.getName(), module);
			modules.put(module, IModule.ON_STATE);

			if (module instanceof Listener) {
				ProxyServer.getInstance().getPluginManager().registerListener(BAT.getInstance(), (Listener) module);
			}

			for (final BATCommand cmd : module.getCommands()) {
				cmdsModules.put(cmd.getName(), module);
				ProxyServer.getInstance().getPluginManager().registerCommand(BAT.getInstance(), cmd);
			}
			if(module.getConfig() != null){
				try {
					module.getConfig().save();
				} catch (final InvalidConfigurationException e) {
					e.printStackTrace();
				}
			}
		} else {
			log.severe("The " + module.getName() + " module encountered an error during his loading.");
		}
	}
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:41,代码来源:ModulesManager.java


示例17: CommentConfig

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
public CommentConfig() {
	try {
              initThrowingExceptions(name);
          } catch (InvalidConfigurationException e) {
              /* The structure of a trigger has changed from 1.3.3 to 1.3.4
               * so if an class cast exception is thrown it's probably caused by an old trigger.
               * We're going to convert this old trigger to the new ones */
              if(e.getCause() instanceof ClassCastException){
                  try {
                      final Configuration config;
                      final File configFile = new File(BAT.getInstance().getDataFolder(), "comment.yml");
                      config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
                      
                      final Configuration triggerSection = config.getSection("triggers");
                      triggers.clear();
                      for(final String triggerName : triggerSection.getKeys()){
                          final List<String> patterns = Arrays.asList(triggerSection.getString(triggerName + ".pattern"));
                          final List<String> cmds = triggerSection.getStringList(triggerName + ".commands");
                          final int triggerNumber = triggerSection.getInt(triggerName + ".triggerNumber");
                          triggers.put(triggerName, new Trigger(triggerNumber, patterns, cmds));
                      }
                      save();
                  } catch (final Exception migrationException) {
                      BAT.getInstance().getLogger().log(Level.SEVERE, "BAT met an error while migrating old triggers", migrationException);
                  }
              }else{
                  BAT.getInstance().getLogger().log(Level.SEVERE, "BAT met an error while loading comments config", e);
              }
          }
}
 
开发者ID:alphartdev,项目名称:BungeeAdminTools,代码行数:31,代码来源:Comment.java


示例18: save

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
 * Save a players data file to disk.
 *
 * @param uuid the uuid in string format of the player.
 */
public void save(UUID uuid) throws RuntimeException {

    if (isLoaded(uuid)) {

        try {
            loadedPlayers.get(uuid.toString()).save();
            plugin.getLogger().info("Successfully saved PlayerDatabase with uuid " + uuid.toString());
        } catch (InvalidConfigurationException e) {
            plugin.getLogger().severe("Failed saving PlayerDatabase with uuid " + uuid.toString());
            throw new RuntimeException(e);
        }
    }

}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:20,代码来源:PlayerManager.java


示例19: initConfig

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
 * Init a new Config and store it inside the Manager
 *
 * @param name   The name which should be used to store the Config to
 * @param config The config which should be inited and stored
 */
public void initConfig(String name, Config config) {
    System.out.println("Attempting to load new Config '" + name + "'");

    try {
        config.init();
        config.save();
        configHashMap.put(name, config);
    } catch (InvalidConfigurationException e) {
        throw new RuntimeException(e);
    }

}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:19,代码来源:ConfigManager.java


示例20: initWorlds

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入依赖的package包/类
/**
 * Init a new Config and store it inside the Manager
 *
 * @param name   The name which should be used to store the Config to
 * @param config The config which should be inited and stored
 */
public void initWorlds(String name, Worlds config) {
    System.out.println("Attempting to load new World Config '" + name + "'");

    try {
        config.init();
        config.save();
        worldsHashMap.put(name, config);
    } catch (InvalidConfigurationException e) {
        throw new RuntimeException(e);
    }

}
 
开发者ID:Relicum,项目名称:Ipsum,代码行数:19,代码来源:ConfigManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BadAclFormatException类代码示例发布时间:2022-05-22
下一篇:
Java RecursiveParam类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap