com.intellectualcrafters.configuration.file.YamlConfiguration.contains()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(116)

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

YamlConfiguration.contains介绍

暂无

代码示例

代码示例来源:origin: IntellectualSites/PlotSquared

/**
 * Setup the style.yml file
 */
private void setupStyle() {
  if (this.version != null) {
    this.style.set("version", this.version.toString());
  }
  Map<String, Object> o = new HashMap<>(4);
  o.put("color.1", "6");
  o.put("color.2", "7");
  o.put("color.3", "8");
  o.put("color.4", "3");
  if (!this.style.contains("color")) {
    for (Entry<String, Object> node : o.entrySet()) {
      this.style.set(node.getKey(), node.getValue());
    }
  }
}

代码示例来源:origin: IntellectualSites/PlotSquared

if (checkVersion(new int[]{3, 4, 0}, lastVersion)) {
  Settings.convertLegacy(configFile);
  if (config.contains("worlds")) {
    ConfigurationSection worldSection = config.getConfigurationSection("worlds");
    worlds.set("worlds", worldSection);

代码示例来源:origin: IntellectualSites/PlotSquared

try {
  HashSet<String> areas = new HashSet<>();
  if (PS.get().worlds.contains("worlds")) {
    ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection("worlds");
    if (worldSection != null) {

代码示例来源:origin: IntellectualSites/PlotSquared

try {
  HashSet<String> areas = new HashSet<>();
  if (PS.get().worlds.contains("worlds")) {
    ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection("worlds");
    if (worldSection != null) {

代码示例来源:origin: IntellectualSites/PlotSquared

for (Map.Entry<String, Object> entry : options.entrySet()) {
  String key = this.getFullId() + "." + entry.getKey();
  if (!commands.contains(key)) {
    commands.set(key, entry.getValue());
    set = true;

代码示例来源:origin: IntellectualSites/PlotSquared

switch (type) {
  case 2: {
    if (!PS.get().worlds.contains(worldPath)) {
      PS.get().worlds.createSection(worldPath);
    if (!PS.get().worlds.contains(worldPath)) {
      PS.get().worlds.createSection(worldPath);
      if (!PS.get().worlds.contains(worldPath)) {
        PS.get().worlds.createSection(worldPath);

代码示例来源:origin: IntellectualSites/PlotSquared

continue;
if (!clone.contains(key)) {
  clone.set(key, areaSection.get(key));
  continue;
if (!key.startsWith("areas") && !clone.contains(key)) {
  clone.set(key, worldSection.get(key));

代码示例来源:origin: IntellectualSites/PlotSquared

if (this.worlds.contains("worlds")) {
  worlds = this.worlds.getConfigurationSection("worlds").getKeys(false);
} else {
  PS.log(C.PREFIX + "&3 - plotworld: &7" + plotArea.getClass().getName());
  PS.log(C.PREFIX + "&3 - manager: &7" + plotManager.getClass().getName());
  if (!this.worlds.contains(path)) {
    this.worlds.createSection(path);
    worldSection = this.worlds.getConfigurationSection(path);
        continue;
      if (!clone.contains(key)) {
        clone.set(key, section.get(key));
        continue;
      if (!key.startsWith("areas") && !clone.contains(key)) {
        clone.set(key, worldSection.get(key));

代码示例来源:origin: IntellectualSites/PlotSquared

@Override
  public void run() {
    String path = "worlds." + pa.worldname;
    if (!PS.get().worlds.contains(path)) {
      PS.get().worlds.createSection(path);
    }
    ConfigurationSection section = PS.get().worlds.getConfigurationSection(path);
    pa.saveConfiguration(section);
    pa.loadConfiguration(section);
    object.plotManager = PS.imp().getPluginName();
    object.setupGenerator = PS.imp().getPluginName();
    String world = SetupUtils.manager.setupWorld(object);
    if (WorldUtil.IMP.isWorld(world)) {
      C.SETUP_FINISHED.send(player);
      player.teleport(WorldUtil.IMP.getSpawn(world));
    } else {
      MainUtil.sendMessage(player, "An error occurred while creating the world: " + pa.worldname);
    }
    try {
      PS.get().worlds.save(PS.get().worldsFile);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
};

代码示例来源:origin: IntellectualSites/PlotSquared

Ratings.CATEGORIES = config.contains("ratings.categories") ? config.getStringList("ratings.categories") : Ratings.CATEGORIES;

相关文章