本文整理汇总了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");
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例6: init
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入方法依赖的package包/类
public void init(final String moduleName){
try {
initThrowingExceptions(moduleName);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
}
示例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 ..."));
}
示例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.");
}
}
}
示例9: trySave
import net.cubespace.Yamler.Config.InvalidConfigurationException; //导入方法依赖的package包/类
@Override
public boolean trySave() {
try {
save();
} catch (InvalidConfigurationException e) {
e.printStackTrace();
return false;
}
return true;
}
示例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();
}
}
}
示例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);
}
}