Skip to content

Commit

Permalink
Reduce error chance when copying world files
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 30, 2016
1 parent ca6b7ca commit 8ebf76e
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -85,7 +85,16 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {

if (copy_from != null) {
try {
FileUtils.copyDirectory(new File(copy_from.getWorld().getName()), new File(World_Name.asString()));
File newFolder = new File(World_Name.asString());
FileUtils.copyDirectory(new File(copy_from.getWorld().getName()), newFolder);
File file = new File(World_Name.asString() + "/uid.dat");
if (file.exists()) {
file.delete();
}
File file2 = new File(World_Name.asString() + "/session.lock");
if (file2.exists()) {
file2.delete();
}
}
catch (Exception ex) {
dB.echoError(ex);
Expand Down

0 comments on commit 8ebf76e

Please sign in to comment.