Added MV conversion

This commit is contained in:
boy0001 2015-06-16 02:15:49 +10:00
parent 5526d4a226
commit 14ce682a63

View File

@ -90,9 +90,13 @@ public class LikePlotMeConverter {
return plotConfig.getConfigurationSection("worlds").getKeys(false); return plotConfig.getConfigurationSection("worlds").getKeys(false);
} }
public void updateBukkitYml(String plugin) { public void updateWorldYml(String plugin, String location) {
try { try {
Path path = Paths.get("bukkit.yml"); Path path = Paths.get(location);
File file = new File(location);
if (!file.exists()) {
return;
}
Charset charset = StandardCharsets.UTF_8; Charset charset = StandardCharsets.UTF_8;
String content = new String(Files.readAllBytes(path), charset); String content = new String(Files.readAllBytes(path), charset);
content = content.replaceAll("PlotMe-DefaultGenerator", "PlotSquared"); content = content.replaceAll("PlotMe-DefaultGenerator", "PlotSquared");
@ -130,8 +134,8 @@ public class LikePlotMeConverter {
final Set<String> worlds = getPlotMeWorlds(plotConfig); final Set<String> worlds = getPlotMeWorlds(plotConfig);
sendMessage("Updating bukkit.yml"); sendMessage("Updating bukkit.yml");
updateBukkitYml(plugin); updateWorldYml(plugin, "bukkit.yml");
updateWorldYml(plugin, "plugins/Multiverse-Core/worlds.yml");
for (final String world : plotConfig.getConfigurationSection("worlds").getKeys(false)) { for (final String world : plotConfig.getConfigurationSection("worlds").getKeys(false)) {
sendMessage("Copying config for: " + world); sendMessage("Copying config for: " + world);
try { try {