private void checkConfigVersions(Configuration config, Path dataFolder) {
if (config.getInt("config-version") < DefaultConfig.CURRENT_CONFIG_VERSION) {
Path configSource = dataFolder.resolve(ConfigType.DEFAULT_CONFIG.getDestinationFileName());
Path configTarget = dataFolder.resolve("config_old.yml");
try {
Files.move(configSource, configTarget, StandardCopyOption.REPLACE_EXISTING);
URL configResource = getClass().getResource(ConfigType.DEFAULT_CONFIG.getClasspathResourceName());
copyResource(configResource, configSource.toFile());
ConsoleCommandSender sender = Bukkit.getConsoleSender();
sender.sendMessage(ChatColor.RED + "Due to a HeavySpleef update your old configuration has been renamed");
sender.sendMessage(ChatColor.RED + "to config_old.yml and a new one has been generated. Make sure to");
sender.sendMessage(ChatColor.RED + "apply your old changes to the new config");
} catch (IOException e) {
getLogger().log(Level.SEVERE, "Could not create updated configuration due to an IOException", e);
}
}
}
HeavySpleef.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:HeavySpleef
作者:
评论列表
文章目录