mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Added bukkit.yml to conversion
This commit is contained in:
parent
eeea1f2d2d
commit
a2480c0458
@ -8,7 +8,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<artifactId>PlotSquared</artifactId>
|
||||
<version>2.11.11</version>
|
||||
<version>2.11.13</version>
|
||||
<name>PlotSquared</name>
|
||||
<packaging>jar</packaging>
|
||||
<build>
|
||||
|
@ -1,6 +1,12 @@
|
||||
package com.intellectualcrafters.plot.database.plotme;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
|
@ -22,6 +22,11 @@ package com.intellectualcrafters.plot.database.plotme;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.Connection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -85,6 +90,17 @@ public class LikePlotMeConverter {
|
||||
return plotConfig.getConfigurationSection("worlds").getKeys(false);
|
||||
}
|
||||
|
||||
public void updateBukkitYml(String plugin) {
|
||||
try {
|
||||
Path path = Paths.get("bukkit.yml");
|
||||
Charset charset = StandardCharsets.UTF_8;
|
||||
String content = new String(Files.readAllBytes(path), charset);
|
||||
content = content.replaceAll("PlotMe-DefaultGenerator", "PlotSquared");
|
||||
content = content.replaceAll(plugin, "PlotSquared");
|
||||
Files.write(path, content.getBytes(charset));
|
||||
} catch (Exception e) {};
|
||||
}
|
||||
|
||||
public boolean run(final APlotMeConnector connector) {
|
||||
try {
|
||||
String dataFolder = getPlotMePath();
|
||||
@ -113,6 +129,9 @@ public class LikePlotMeConverter {
|
||||
sendMessage(" - " + dbPrefix + "Plots");
|
||||
final Set<String> worlds = getPlotMeWorlds(plotConfig);
|
||||
|
||||
sendMessage("Updating bukkit.yml");
|
||||
updateBukkitYml(plugin);
|
||||
|
||||
for (final String world : plotConfig.getConfigurationSection("worlds").getKeys(false)) {
|
||||
sendMessage("Copying config for: " + world);
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user