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


Java InvalidConfigurationException.printStackTrace方法代码示例

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


在下文中一共展示了InvalidConfigurationException.printStackTrace方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: trySave

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入方法依赖的package包/类
@Override
public boolean trySave() {
    try {
        save();
    } catch (InvalidConfigurationException e) {
        e.printStackTrace();
        return false;
    }
    return true;
}
 
开发者ID:xxyy,项目名称:commandblockerultimate,代码行数:11,代码来源:CBUConfig.java

示例10: sendBossBar

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入方法依赖的package包/类
private void sendBossBar(Player player)
{
    if (Bukkit.getBukkitVersion().contains("1.9") || Bukkit.getServer().getBukkitVersion().contains("1.10") || Bukkit.getBukkitVersion().contains("1.11") || Bukkit.getBukkitVersion().contains("1.11") || Bukkit.getBukkitVersion().contains("1.12") || Bukkit.getBukkitVersion().contains("1.13") || Bukkit.getBukkitVersion().contains("1.14"))
    {
        if (validateColor(Thirst.getInstance().getYAMLConfig().barColor) != null && validateStyle(Thirst.getInstance().getYAMLConfig().barStyle) != null) {
            BossBar bar;

            if (getThirstData(player).getBar() != null) {
                bar = getThirstData(player).getBar();
                bar.setTitle(ChatColor.translateAlternateColorCodes('&', getThirstString(player)));
                bar.setColor(BarColor.valueOf(Thirst.getInstance().getYAMLConfig().barColor.toUpperCase()));
                bar.setStyle(BarStyle.valueOf(Thirst.getInstance().getYAMLConfig().barStyle.toUpperCase()));
                if (!bar.getPlayers().contains(player))
                    bar.addPlayer(player);
            } else {
                bar = Bukkit.createBossBar(ChatColor.translateAlternateColorCodes('&', getThirstString(player)), BarColor.valueOf(Thirst.getInstance().getYAMLConfig().barColor.toUpperCase()), BarStyle.valueOf(Thirst.getInstance().getYAMLConfig().barStyle.toUpperCase()));
                bar.addPlayer(player);
                getThirstData(player).setBar(bar);
            }

            if (Thirst.getInstance().getYAMLConfig().useBarProgress)
                bar.setProgress((double) getPlayerThirst(player) / 100);
        }
    }
    else
    {
        try
        {
            Thirst.getInstance().getLogger().log(Level.SEVERE, "[Thirst V"+ Thirst.getInstance().getDescription().getVersion()+"] Your Spigot version is not compatible with the Bossbar display type, please use version 1.9 or higher.");
            Thirst.getInstance().getLogger().log(Level.SEVERE, "[Thirst V"+ Thirst.getInstance().getDescription().getVersion()+"] Changing to display type ACTION...");

            UtilActionBar.getInstance().sendActionBar(player, ThirstManager.getThirst().getThirstString(player));

            Thirst.getInstance().getYAMLConfig().displayType = "ACTION";
            Thirst.getInstance().getYAMLConfig().save();
        }
        catch (InvalidConfigurationException e)
        {
            e.printStackTrace();
        }
    }
}
 
开发者ID:GamerKing195,项目名称:Thirst,代码行数:43,代码来源:ThirstManager.java

示例11: onEnable

import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入方法依赖的package包/类
@Override
public void onEnable(){
	// Lets get started! Firstly we need to load up our config!
	Database DBConfig = null;
	try{
		DBConfig = new Database(this);
		DBConfig.init();			
		
	}catch(InvalidConfigurationException e){
		System.out.println("Your database configuration contains an error");
		System.out.println("Please check your YAML syntax and re-try");
		e.printStackTrace();
		// Kill the plugin
		System.out.println("Y U KILL ME :'(");
		getProxy().getPluginManager().getPlugins().remove(this);
	}
	
	// Get the database credentials
	
	String DBHost = "jdbc:mysql://"+DBConfig.getDb_host()+":3306/"+DBConfig.getDb_name();
	String DBUser = DBConfig.getDb_user();
	String DBPass = DBConfig.getDb_pass();
	
	// Connect to the database
	if(Database.Connect(DBHost, DBUser, DBPass)){
		// Database connection is good!
		
		// Load bans and mutes into the database
		
		// Register commands
		getProxy().getPluginManager().registerCommand(this, new Ban(this));
		getProxy().getPluginManager().registerCommand(this, new BanInfo(this));
		getProxy().getPluginManager().registerCommand(this, new IPBan(this));
		getProxy().getPluginManager().registerCommand(this, new Kick(this));
		getProxy().getPluginManager().registerCommand(this, new Mute(this));
		getProxy().getPluginManager().registerCommand(this, new TempBan(this));
		getProxy().getPluginManager().registerCommand(this, new TempMute(this));
		getProxy().getPluginManager().registerCommand(this, new UnBan(this));
		getProxy().getPluginManager().registerCommand(this, new UnMute(this));
		
		// Register listeners
		getProxy().getPluginManager().registerListener(this, new Chat(this));
		getProxy().getPluginManager().registerListener(this, new Join(this));
		
	}else{
		//Failed to connect to the database
		System.out.println("Failed to connect to database! Disabling plugin");
		getProxy().getPluginManager().getPlugins().remove(this);
	}
	
}
 
开发者ID:lukeer31,项目名称:Bangee,代码行数:52,代码来源:Bangee.java


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