Skip to content

Commit

Permalink
made the delete world method a lil nicer (ty das)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Scherf <[email protected]>
  • Loading branch information
sh0inx and dlsf authored May 10, 2024
1 parent d0fe9f8 commit 00b4258
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,10 @@ public IslandManager() {
}

public boolean deleteWorld(File path) {
if(path.exists()) {
File files[] = path.listFiles();
for(int i=0; i<files.length; i++) {
if(files[i].isDirectory()) {
deleteWorld(files[i]);
} else {
files[i].delete();
}
}
}
return(path.delete());
Files.walk(pathToBeDeleted)
.sorted(Comparator.reverseOrder())
.map(Path::toFile)
.forEach(File::delete);
}

// Bukkit's createWorld method requires "/" no matter which platform we're on.
Expand Down

0 comments on commit 00b4258

Please sign in to comment.