mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Added MV conversion
This commit is contained in:
parent
5526d4a226
commit
14ce682a63
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user