BungeemodeAddon.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:HeavySpleef 作者:
private boolean checkCopyConfig() throws IOException {
    File file = new File(getDataFolder(), CONFIG_FILE_NAME);
    if (file.exists()) {
        Configuration config = YamlConfiguration.loadConfiguration(file);
        int version = config.getInt("config-version");

        if (version < BungeemodeConfig.CURRENT_CONFIG_VERSION) {
            Path dataFolderPath = getDataFolder().toPath();
            Files.move(file.toPath(), dataFolderPath.resolve("config_old.yml"), StandardCopyOption.REPLACE_EXISTING);
            return true;
        }
    } else {
        return true;
    }

    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号