From d262577c59c6b4346243abd8b7fff1eca50b585a Mon Sep 17 00:00:00 2001 From: Shyanne Date: Fri, 10 May 2024 16:18:58 -0400 Subject: [PATCH] reverted deleteWorld method overhaul --- .../iridiumskyblock/managers/IslandManager.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java index 0f20871be..b7dddd4b8 100644 --- a/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java +++ b/src/main/java/com/iridium/iridiumskyblock/managers/IslandManager.java @@ -40,6 +40,8 @@ import org.jetbrains.annotations.Nullable; import java.io.File; +import java.io.IOException; +import java.nio.file.Files; import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.CompletableFuture; @@ -53,10 +55,17 @@ public IslandManager() { } public boolean deleteWorld(File path) { - Files.walk(pathToBeDeleted) - .sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); + if(path.exists()) { + File files[] = path.listFiles(); + for(int i=0; i