mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-07-01 17:15:03 +02:00
Fixes #452
This commit is contained in:
parent
119a332d83
commit
400d0319ab
|
@ -70,6 +70,8 @@ public class Settings extends Config {
|
||||||
public static final class PATHS {
|
public static final class PATHS {
|
||||||
public String HISTORY = "history";
|
public String HISTORY = "history";
|
||||||
public String CLIPBOARD = "clipboard";
|
public String CLIPBOARD = "clipboard";
|
||||||
|
@Comment("Each player has their own sub directory for schematics")
|
||||||
|
public boolean PER_PLAYER_SCHEMATICS = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,8 @@ public class BrushCommands {
|
||||||
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
|
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), player.getUniqueId() + File.separator + filename);
|
File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir);
|
||||||
|
File dir = new File(working, (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? (player.getUniqueId().toString() + File.separator) : "") + filename);
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
if (!filename.contains("/") && !filename.contains("\\")) {
|
if (!filename.contains("/") && !filename.contains("\\")) {
|
||||||
dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), filename);
|
dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), filename);
|
||||||
|
|
|
@ -119,7 +119,8 @@ public class SchematicCommands {
|
||||||
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
|
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
File dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), player.getUniqueId().toString());
|
File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir);
|
||||||
|
File dir = Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? new File(working, player.getUniqueId().toString()) : working;
|
||||||
File f = this.worldEdit.getSafeSaveFile(player, dir, filename, format.getExtension(), format.getExtension());
|
File f = this.worldEdit.getSafeSaveFile(player, dir, filename, format.getExtension(), format.getExtension());
|
||||||
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
|
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
|
||||||
File directory = f.getParentFile();
|
File directory = f.getParentFile();
|
||||||
|
@ -187,7 +188,8 @@ public class SchematicCommands {
|
||||||
BBC.NO_PERM.send(player, "worldedit.schematic.save.other");
|
BBC.NO_PERM.send(player, "worldedit.schematic.save.other");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final File dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), player.getUniqueId().toString());
|
File working = this.worldEdit.getWorkingDirectoryFile(config.saveDir);
|
||||||
|
File dir = Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS ? new File(working, player.getUniqueId().toString()) : working;
|
||||||
File f = this.worldEdit.getSafeSaveFile(player, dir, filename, format.getExtension(), format.getExtension());
|
File f = this.worldEdit.getSafeSaveFile(player, dir, filename, format.getExtension(), format.getExtension());
|
||||||
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
|
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
|
||||||
File directory = f.getParentFile();
|
File directory = f.getParentFile();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user