This commit is contained in:
Jesse Boyd 2017-03-06 14:45:29 +11:00
parent 119a332d83
commit 400d0319ab
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 8 additions and 3 deletions

View File

@ -70,6 +70,8 @@ public class Settings extends Config {
public static final class PATHS {
public String HISTORY = "history";
public String CLIPBOARD = "clipboard";
@Comment("Each player has their own sub directory for schematics")
public boolean PER_PLAYER_SCHEMATICS = true;
}

View File

@ -265,7 +265,8 @@ public class BrushCommands {
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
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 (!filename.contains("/") && !filename.contains("\\")) {
dir = new File(this.worldEdit.getWorkingDirectoryFile(config.saveDir), filename);

View File

@ -119,7 +119,8 @@ public class SchematicCommands {
BBC.NO_PERM.send(player, "worldedit.schematic.load.other");
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());
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
File directory = f.getParentFile();
@ -187,7 +188,8 @@ public class SchematicCommands {
BBC.NO_PERM.send(player, "worldedit.schematic.save.other");
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());
if (f.getName().replaceAll("." + format.getExtension(), "").isEmpty()) {
File directory = f.getParentFile();