mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 04:46:40 +00:00
Revamped file dialog handling.
This commit is contained in:
@ -181,7 +181,8 @@ public class ClipboardCommands {
|
||||
|
||||
String filename = args.getString(0);
|
||||
File dir = we.getWorkingDirectoryFile(config.saveDir);
|
||||
File f = we.getSafeFile(player, dir, filename, "schematic");
|
||||
File f = we.getSafeOpenFile(player, dir, filename, "schematic",
|
||||
new String[] {"schematic"});
|
||||
|
||||
try {
|
||||
String filePath = f.getCanonicalPath();
|
||||
@ -218,7 +219,8 @@ public class ClipboardCommands {
|
||||
String filename = args.getString(0);
|
||||
|
||||
File dir = we.getWorkingDirectoryFile(config.saveDir);
|
||||
File f = we.getSafeFile(player, dir, filename, "schematic");
|
||||
File f = we.getSafeSaveFile(player, dir, filename, "schematic",
|
||||
new String[] {"schematic"});
|
||||
|
||||
if (!dir.exists()) {
|
||||
if (!dir.mkdir()) {
|
||||
|
@ -48,7 +48,8 @@ public class ScriptingCommands {
|
||||
session.setLastScript(args.getString(0));
|
||||
|
||||
File dir = we.getWorkingDirectoryFile(we.getConfiguration().scriptsDir);
|
||||
File f = we.getSafeFile(player, dir, args.getString(0), "js");
|
||||
File f = we.getSafeOpenFile(player, dir, args.getString(0), "js",
|
||||
new String[] {"js"});
|
||||
|
||||
we.runScript(player, f, scriptArgs);
|
||||
}
|
||||
@ -76,7 +77,8 @@ public class ScriptingCommands {
|
||||
String[] scriptArgs = args.getSlice(0);
|
||||
|
||||
File dir = we.getWorkingDirectoryFile(we.getConfiguration().scriptsDir);
|
||||
File f = we.getSafeFile(player, dir, lastScript, "js");
|
||||
File f = we.getSafeOpenFile(player, dir, lastScript, "js",
|
||||
new String[] {"js"});
|
||||
|
||||
we.runScript(player, f, scriptArgs);
|
||||
|
||||
|
Reference in New Issue
Block a user