private void checkConfigVersions(Configuration config, Path dataFolder) {
if (config.getInt("config-version", 0) < TradeConfiguration.CURRENT_CONFIG_VERSION) {
Path configSource = dataFolder.resolve(TradeConfiguration.DESTINATION_FILE_NAME);
Path configTarget = dataFolder.resolve("config_old.yml");
try {
Files.move(configSource, configTarget, StandardCopyOption.REPLACE_EXISTING);
URL configResource = getClass().getResource(TradeConfiguration.CLASSPATH_RESOURCE_NAME);
copyResource(configResource, configSource.toFile());
ConsoleCommandSender sender = Bukkit.getConsoleSender();
sender.sendMessage(ChatColor.RED + "Due to a SimpleTrading 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);
}
}
}
SimpleTrading.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:simple-trading
作者:
评论列表
文章目录