Fix BauSystem for old BauWorld
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
afd292851d
Commit
fe4542c67b
@ -108,18 +108,32 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void fixBauSystem() {
|
private void fixBauSystem() {
|
||||||
|
int number = -1;
|
||||||
|
try {
|
||||||
|
String string = new File(world.getWorldFolder(), "sections.yapion").getCanonicalPath();
|
||||||
|
if (string.endsWith("/sections3.yml")) number = 3;
|
||||||
|
if (string.endsWith("/sections4.yml")) number = 4;
|
||||||
|
} catch (IOException e) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
|
Bukkit.shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (number == -1) {
|
||||||
|
Bukkit.shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!new File(world.getWorldFolder(),"prototypes.yapion").exists()) {
|
if (!new File(world.getWorldFolder(),"prototypes.yapion").exists()) {
|
||||||
createLink("prototypes.yapion");
|
createLink("prototypes" + number + ".yapion", "prototypes.yapion");
|
||||||
}
|
}
|
||||||
if (!new File(world.getWorldFolder(),"regions.yapion").exists()) {
|
if (!new File(world.getWorldFolder(),"regions.yapion").exists()) {
|
||||||
createLink("regions.yapion");
|
createLink("regions" + number + ".yapion", "regions.yapion");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createLink(String name) {
|
private void createLink(String source, String destination) {
|
||||||
try {
|
try {
|
||||||
Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/backbone/server/Bau15/{0} .", new String[]{name});
|
Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/backbone/server/Bau15/{0} {1}", new String[]{source, destination});
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/backbone/server/Bau15/" + name, ".");
|
ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/backbone/server/Bau15/" + source, destination);
|
||||||
processBuilder.directory(world.getWorldFolder());
|
processBuilder.directory(world.getWorldFolder());
|
||||||
processBuilder.inheritIO();
|
processBuilder.inheritIO();
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren