gpt4 book ai didi

com.sk89q.util.yaml.YAMLProcessor.load()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 04:50:49 25 4
gpt4 key购买 nike

本文整理了Java中com.sk89q.util.yaml.YAMLProcessor.load()方法的一些代码示例,展示了YAMLProcessor.load()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLProcessor.load()方法的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLProcessor
类名称:YAMLProcessor
方法名:load

YAMLProcessor.load介绍

[英]Loads the configuration file.
[中]加载配置文件。

代码示例

代码示例来源:origin: EngineHub/WorldEdit

config.load();
} catch (IOException e) {
  logger.log(Level.WARNING, "Error loading WEPIF configuration", e);

代码示例来源:origin: EngineHub/WorldEdit

@Override
public void load() {
  try {
    config.load();
  } catch (IOException e) {
    logger.log(Level.WARNING, "Error loading WorldEdit configuration", e);

代码示例来源:origin: EngineHub/CommandBook

public void load() {
  storedSpawns.clear();
  try {
    config.load();
  } catch (IOException ignore) {}
  for (World world : Bukkit.getServer().getWorlds())
    loadWorld(world);
}

代码示例来源:origin: EngineHub/CommandBook

processor.load();
} catch (IOException e) {
  CommandBook.logger().log(Level.WARNING, "Error loading sessions persistence file for user " + commander, e);

代码示例来源:origin: EngineHub/CommandBook

private boolean reloadMessages() {
  try {
    help.load();
  } catch (IOException e) {
    return false;
  }
  List<String> keys = help.getKeys("topics");
  if (keys == null) {
    help.setProperty("topics.help", demoHelpMessage);
    keys = new ArrayList<String>();
    keys.add("help");
    help.save();
  }
  for (String key : keys) {
    String information = help.getString("topics." + key);
    if (information != null && information.trim().length() != 0) {
      information = replaceColorMacros(information);
      String[] split = information.split("\\n");
      for (int i = 0; i < split.length; i++) {
        split[i] = split[i].replaceAll("[\\r\\n]", "");
      }
      messages.put(key.toLowerCase(), split);
    }
  }
  return true;
}

代码示例来源:origin: EngineHub/CommandBook

/**
 * Loads the configuration.
 */
@Override
public YAMLProcessor createConfiguration() {
  final File configFile = new File(getDataFolder(), "config.yml");
  YAMLProcessor config = new YAMLProcessor(configFile, true, YAMLFormat.EXTENDED);
  YAMLProcessor comments = new DefaultsFileYAMLProcessor("config-comments.yml", false);
  try {
    if (!configFile.exists()) {
      configFile.getParentFile().mkdirs();
      configFile.createNewFile();
    }
    config.load();
    comments.load();
  } catch (Exception e) {
    getLogger().log(Level.WARNING, "Error loading configuration: ", e);
  }
  for (Map.Entry<String, Object> e : comments.getMap().entrySet()) {
    if (e.getValue() != null) {
      config.setComment(e.getKey(), e.getValue().toString());
    }
  }
  // Migrate the old configuration, if we need to
  final String result = new LegacyCommandBookConfigurationMigrator(configFile, config).migrate();
  if (result != null) {
    logger().severe("Error migrating CommandBook configuration: " + result);
  }
  return config;
}

代码示例来源:origin: EngineHub/WorldGuard

config.load();
} catch (FileNotFoundException e) {
  return new HashSet<>(loaded.values());

代码示例来源:origin: EngineHub/WorldGuard

config.load();
} catch (IOException e) {
  log.severe("Error reading configuration for global config: ");

代码示例来源:origin: EngineHub/CommandBook

@Command(aliases = {"reload"}, usage = "", desc = "Reload CommandBook's settings", min = 0, max = 0)
@CommandPermissions({"commandbook.reload"})
public static void reload(CommandContext args, CommandSender sender) throws CommandException {
  try {
    CommandBook.inst().getGlobalConfiguration().load();
  } catch (IOException e) {
    sender.sendMessage(ChatColor.RED + "Error reolading configuration: " + e.getMessage());
    sender.sendMessage(ChatColor.RED + "See console for details!");
    CommandBook.logger().log(Level.WARNING, "Error reloading configuration: " + e, e);
  }
  CommandBook.inst().loadConfiguration();
  CommandBook.inst().getComponentManager().reloadComponents();
  sender.sendMessage(ChatColor.YELLOW + "CommandBook's configuration has been reloaded.");
}

代码示例来源:origin: EngineHub/CommandBook

final YAMLProcessor jarComponentAliases = new DefaultsFileYAMLProcessor("components.yml", false);
try {
  jarComponentAliases.load();
} catch (IOException e) {
  getLogger().severe("Error loading component aliases!");

代码示例来源:origin: EngineHub/WorldGuard

public void loadConfiguration() {
  try {
    config.load();
  } catch (IOException e) {
    log.severe("Error reading configuration for world " + worldName + ": ");

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com