gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 15:50:31 27 4
gpt4 key购买 nike

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

YamlConfiguration.getConfigurationSection介绍

暂无

代码示例

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

Settings.convertLegacy(configFile);
if (config.contains("worlds")) {
  ConfigurationSection worldSection = config.getConfigurationSection("worlds");
  worlds.set("worlds", worldSection);
  try {

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

yml.set(remove, null);
ConfigurationSection config = PS.get().style.getConfigurationSection("color");
Set<String> styles = config.getKeys(false);

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

HashSet<String> areas = new HashSet<>();
if (PS.get().worlds.contains("worlds")) {
  ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection("worlds");
  if (worldSection != null) {
    for (String worldKey : worldSection.getKeys(false)) {

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

/**
 * Check if a PlotArea is compatible (move/copy etc).
 * @param plotArea the {@code PlotArea} to compare
 * @return true if both areas are compatible
 */
public boolean isCompatible(PlotArea plotArea) {
  ConfigurationSection section = PS.get().worlds.getConfigurationSection("worlds");
  for (ConfigurationNode setting : plotArea.getSettingNodes()) {
    Object constant = section.get(plotArea.worldname + '.' + setting.getConstant());
    if (constant == null || !constant.equals(section.get(this.worldname + '.' + setting.getConstant()))) {
      return false;
    }
  }
  return true;
}

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

public static byte[] getBytes(PlotArea plotArea) {
  ConfigurationSection section = PS.get().worlds.getConfigurationSection("worlds." + plotArea.worldname);
  YamlConfiguration config = new YamlConfiguration();
  String generator = SetupUtils.manager.getGenerator(plotArea);
  if (generator != null) {
    config.set("generator.plugin", generator);
  }
  for (String key : section.getKeys(true)) {
    config.set(key, section.get(key));
  }
  return config.saveToString().getBytes();
}

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

HashSet<String> areas = new HashSet<>();
if (PS.get().worlds.contains("worlds")) {
  ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection("worlds");
  if (worldSection != null) {
    for (String worldKey : worldSection.getKeys(false)) {

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

ConfigurationSection section = this.worlds.getConfigurationSection("worlds." + world);
plotworld.saveConfiguration(section);
plotworld.loadConfiguration(section);

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

@Override
public void setGenerator(String worldName) {
  World world = SpongeUtil.getWorld(worldName);
  if (world == null) {
    // create world
    ConfigurationSection worldConfig = PS.get().worlds.getConfigurationSection("worlds." + worldName);
    String manager = worldConfig.getString("generator.plugin", "PlotSquared");
    String generator = worldConfig.getString("generator.init", manager);
    int type = worldConfig.getInt("generator.type");
    int terrain = worldConfig.getInt("generator.terrain");
    SetupObject setup = new SetupObject();
    setup.plotManager = manager;
    setup.setupGenerator = generator;
    setup.type = type;
    setup.terrain = terrain;
    setup.step = new ConfigurationNode[0];
    setup.world = worldName;
    SetupUtils.manager.setupWorld(setup);
    world = SpongeUtil.getWorld(worldName);
  } else {
    throw new IllegalArgumentException("World already loaded: " + worldName + "???");
  }
  WorldGenerator wg = world.getWorldGenerator();
  GenerationPopulator gen = wg.getBaseGenerationPopulator();
  if (gen instanceof GeneratorWrapper) {
    PS.get().loadWorld(worldName, (GeneratorWrapper) gen);
  } else {
    throw new UnsupportedOperationException("NOT IMPLEMENTED YET2! " + worldName + " | " + gen);
  }
}

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

PS.get().worlds.createSection(worldPath);
ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection(worldPath);
if (object.id != null) {
  String areaName = object.id + "-" + object.min + "-" + object.max;
  PS.get().worlds.createSection(worldPath);
ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection(worldPath);
for (ConfigurationNode step : steps) {
  worldSection.set(step.getConstant(), step.getValue());
    PS.get().worlds.createSection(worldPath);
  ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection(worldPath);
  for (ConfigurationNode step : steps) {
    worldSection.set(step.getConstant(), step.getValue());

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

Set<String> worlds;
if (this.worlds.contains("worlds")) {
  worlds = this.worlds.getConfigurationSection("worlds").getKeys(false);
} else {
  worlds = new HashSet<>();
ConfigurationSection worldSection = this.worlds.getConfigurationSection(path);
int type;
if (worldSection != null) {
  if (!this.worlds.contains(path)) {
    this.worlds.createSection(path);
    worldSection = this.worlds.getConfigurationSection(path);

代码示例来源: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

final ConfigurationSection section = this.worlds.getConfigurationSection("worlds");
if (section != null) {
  for (String world : section.getKeys(false)) {

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

@Override
public void run(PlotArea area) {
  ConfigurationSection worldSection = PS.get().worlds.getConfigurationSection("worlds." + area.worldname);
  if (worldSection == null) {
    return;

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

SinglePlotArea area = ((SinglePlotAreaManager) manager).getArea();
addPlotArea(area);
ConfigurationSection section = worlds.getConfigurationSection("worlds.*");
if (section == null) {
  section = worlds.createSection("worlds.*");

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