From efe6eec885ed7fe0a2dc92a9360365215983ded0 Mon Sep 17 00:00:00 2001 From: GeorgeRNG <81434111+GeorgeRNG@users.noreply.github.com> Date: Sun, 31 Mar 2024 13:33:30 +0100 Subject: [PATCH] It misses args cuz my class doesn't have it, so 100% working now it seems --- .../dev/dfonline/codeclient/Commands.java | 19 ++++++++-- .../codeclient/action/impl/ScanPlot.java | 36 ++++++++++--------- .../hypercube/template/Template.java | 11 ------ 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/main/java/dev/dfonline/codeclient/Commands.java b/src/main/java/dev/dfonline/codeclient/Commands.java index 979fdb41..2ea23737 100644 --- a/src/main/java/dev/dfonline/codeclient/Commands.java +++ b/src/main/java/dev/dfonline/codeclient/Commands.java @@ -218,18 +218,31 @@ else if(!Files.isDirectory(currentPath)) { } } + try { + if(Files.list(currentPath).findFirst().isPresent()) { + Utility.sendMessage("Please use an empty directory to save into.",ChatType.FAIL); + return -1; + } + } + catch (Exception ignored) { + Utility.sendMessage("An error occurred when reading the directory.",ChatType.FAIL); + } + Utility.sendMessage("Scanning plot. Use /abort to abort.",ChatType.INFO); - var scan = new ArrayList