From 14ce682a637eb82b4efc8efee6e55eb43336eaed Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 16 Jun 2015 02:15:49 +1000 Subject: [PATCH] Added MV conversion --- .../plot/database/plotme/LikePlotMeConverter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/plotme/LikePlotMeConverter.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/plotme/LikePlotMeConverter.java index 17bee357f..2a1b86a05 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/plotme/LikePlotMeConverter.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/database/plotme/LikePlotMeConverter.java @@ -90,9 +90,13 @@ public class LikePlotMeConverter { return plotConfig.getConfigurationSection("worlds").getKeys(false); } - public void updateBukkitYml(String plugin) { + public void updateWorldYml(String plugin, String location) { 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; String content = new String(Files.readAllBytes(path), charset); content = content.replaceAll("PlotMe-DefaultGenerator", "PlotSquared"); @@ -130,8 +134,8 @@ public class LikePlotMeConverter { final Set worlds = getPlotMeWorlds(plotConfig); 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)) { sendMessage("Copying config for: " + world); try {