gpt4 book ai didi

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

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

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

YAMLProcessor.save介绍

[英]Saves the configuration to disk. All errors are clobbered.
[中]将配置保存到磁盘。所有错误都会被删除。

代码示例

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

config.save();

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

@Override
  public void disableUuidMigration() {
    config.setProperty("regions.uuid-migration.perform-on-next-start", false);
    if (!config.save()) {
      log.severe("Error saving configuration!");
    }
  }
}

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

@Command(aliases = {"save"}, usage = "", desc = "Save CommandBook's settings", min = 0, max = 0)
@CommandPermissions({"commandbook.save"})
public static void save(CommandContext args, CommandSender sender) throws CommandException {
  CommandBook.inst().getGlobalConfiguration().save();
  sender.sendMessage(ChatColor.YELLOW + "CommandBook's configuration has been reloaded.");
}

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

@Override
public void disable() {
  for (Player player : CommandBook.server().getOnlinePlayers()) {
    String type = getType(player.getClass());
    for (PersistentSession session : getSessions(player)) {
      session.handleDisconnect();
      session.save(new YAMLNodeConfigurationNode(getSessionConfiguration(type, UUIDUtil.toUniqueString(player), session.getClass())));
    }
    YAMLProcessor proc = getUserConfiguration(type, UUIDUtil.toUniqueString(player), false);
    if (proc != null) {
      proc.save();
    }
  }
}

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

/**
 * Called on player disconnect.
 *
 * @param event Relevant event details
 */
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
  Player player = event.getPlayer();
  String type = getType(player.getClass());
  for (PersistentSession session : getSessions(event.getPlayer())) {
    session.handleDisconnect();
    session.save(new YAMLNodeConfigurationNode(getSessionConfiguration(type, UUIDUtil.toUniqueString(player), session.getClass())));
  }
  YAMLProcessor proc = getUserConfiguration(type, UUIDUtil.toUniqueString(player), false);
  if (proc != null) {
    proc.save();
  }
}

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

config.save();

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

public WrappedSpawn setWorldSpawn(Location loc) {
  WrappedSpawn spawn = getEnrichment(loc.getWorld());
  loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
  spawn.setPitch(loc.getPitch());
  spawn.setYaw(loc.getYaw());
  config.setProperty(spawn.getWorldName() + ".pitch", spawn.getPitch());
  config.setProperty(spawn.getWorldName() + ".yaw", spawn.getYaw());
  config.setHeader(CONFIG_HEADER);
  config.save();
  return spawn;
}

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

config.save();

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