diff --git a/src/main/java/de/fanta/challenges/utils/SaveWorldUtils.java b/src/main/java/de/fanta/challenges/utils/SaveWorldUtils.java index 1c99518..66a5d77 100644 --- a/src/main/java/de/fanta/challenges/utils/SaveWorldUtils.java +++ b/src/main/java/de/fanta/challenges/utils/SaveWorldUtils.java @@ -9,7 +9,6 @@ import de.fanta.challenges.events.ServerStatusChangedEvent; import org.apache.commons.io.FileUtils; import org.bukkit.Bukkit; -import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.entity.Player; @@ -21,13 +20,10 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.StandardCopyOption; -import java.util.ArrayList; import java.util.HashMap; import java.util.Properties; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicReference; import java.util.logging.Level; public class SaveWorldUtils { @@ -240,7 +236,7 @@ if (Files.isDirectory(source)) { target.mkdir(); } else { - Files.copy(source, target.toPath(), StandardCopyOption.REPLACE_EXISTING); + Files.move(source, target.toPath(), StandardCopyOption.REPLACE_EXISTING); copiedBytes[0] += source.toFile().length(); progress = (double) copiedBytes[0] / totalBytes[0] * 100; } @@ -256,15 +252,15 @@ int progress = (int) (value / 100 * 40); StringBuilder progressBar = new StringBuilder(); - progressBar.append(ChatUtil.RED + "["); + progressBar.append(ChatUtil.RED).append("["); for (int i = 0; i < 40; i++) { if (i < progress) { - progressBar.append(ChatUtil.PINK + "|"); + progressBar.append(ChatUtil.PINK).append("|"); } else { - progressBar.append(ChatUtil.GREEN + "|"); + progressBar.append(ChatUtil.GREEN).append("|"); } } - progressBar.append(ChatUtil.RED + "] " + ChatUtil.PINK + String.format("%.2f", value) + "%"); + progressBar.append(ChatUtil.RED).append("] ").append(ChatUtil.PINK).append(String.format("%.2f", value)).append("%"); return progressBar.toString(); }