mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
*And this
This commit is contained in:
parent
7bdcde6d24
commit
a2a43816ad
@ -452,10 +452,10 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
TaskManager.runTaskLaterAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (new LikePlotMeConverter().run(new ClassicPlotMeConnector())) {
|
||||
if (new LikePlotMeConverter("PlotMe").run(new ClassicPlotMeConnector())) {
|
||||
return;
|
||||
}
|
||||
if (new LikePlotMeConverter().run(new PlotMeConnector_017())) {
|
||||
if (new LikePlotMeConverter("PlotMe").run(new PlotMeConnector_017())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class LikePlotMeConverter {
|
||||
|
||||
private final String plugin;
|
||||
|
||||
public LikePlotMeConverter(String plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public static String getWorld(String world) {
|
||||
for (World newWorld : Bukkit.getWorlds()) {
|
||||
if (newWorld.getName().equalsIgnoreCase(world)) {
|
||||
@ -48,7 +54,7 @@ public class LikePlotMeConverter {
|
||||
}
|
||||
|
||||
public String getPlotMePath() {
|
||||
return new File(".").getAbsolutePath() + File.separator + "plugins" + File.separator + "PlotMe" + File.separator;
|
||||
return new File(".").getAbsolutePath() + File.separator + "plugins" + File.separator + plugin + File.separator;
|
||||
}
|
||||
|
||||
public FileConfiguration getPlotMeConfig(String dataFolder) {
|
||||
@ -66,7 +72,7 @@ public class LikePlotMeConverter {
|
||||
public void mergeWorldYml(FileConfiguration plotConfig) {
|
||||
try {
|
||||
File genConfig =
|
||||
new File("plugins" + File.separator + "PlotMe" + File.separator + "PlotMe-DefaultGenerator" + File.separator + "config.yml");
|
||||
new File("plugins" + File.separator + plugin + File.separator + "PlotMe-DefaultGenerator" + File.separator + "config.yml");
|
||||
if (genConfig.exists()) {
|
||||
YamlConfiguration yml = YamlConfiguration.loadConfiguration(genConfig);
|
||||
for (String key : yml.getKeys(true)) {
|
||||
@ -91,8 +97,10 @@ public class LikePlotMeConverter {
|
||||
return;
|
||||
}
|
||||
String content = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
|
||||
content = content.replaceAll("PlotMe-DefaultGenerator", "PlotSquared");
|
||||
content = content.replaceAll("PlotMe", "PlotSquared");
|
||||
content = content.replace("PlotMe-DefaultGenerator", "PlotSquared");
|
||||
content = content.replace("PlotMe", "PlotSquared");
|
||||
content = content.replace("AthionPlots", "PlotSquared");
|
||||
content = content.replace("PlotZWorld", "PlotSquared");
|
||||
Files.write(path, content.getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user