diff --git a/src/main/java/net/szum123321/textile_backup/commands/restore/KillRestoreCommand.java b/src/main/java/net/szum123321/textile_backup/commands/restore/KillRestoreCommand.java index 33505f1..902b6b9 100644 --- a/src/main/java/net/szum123321/textile_backup/commands/restore/KillRestoreCommand.java +++ b/src/main/java/net/szum123321/textile_backup/commands/restore/KillRestoreCommand.java @@ -26,11 +26,15 @@ import net.szum123321.textile_backup.Statics; public class KillRestoreCommand { public static LiteralArgumentBuilder register() { - return CommandManager.literal("kill_r") //TODO: come up with something better + return CommandManager.literal("killR") .executes(ctx -> { if(Statics.restoreAwaitThread != null && Statics.restoreAwaitThread.isAlive()) { Statics.restoreAwaitThread.interrupt(); ctx.getSource().sendFeedback(new LiteralText("Backup restoration successfully stopped"), false); + Statics.LOGGER.info("{} cancelled backup restoration.", ctx.getSource().getEntity() != null ? + "Player: " + ctx.getSource().getName() : + "SERVER" + ); } else { ctx.getSource().sendFeedback(new LiteralText("Failed to stop backup restoration"), false); } diff --git a/src/main/java/net/szum123321/textile_backup/core/restore/AwaitThread.java b/src/main/java/net/szum123321/textile_backup/core/restore/AwaitThread.java index acf557f..2ab2d74 100644 --- a/src/main/java/net/szum123321/textile_backup/core/restore/AwaitThread.java +++ b/src/main/java/net/szum123321/textile_backup/core/restore/AwaitThread.java @@ -37,6 +37,7 @@ public class AwaitThread extends Thread { try { Thread.sleep(delay * 1000); } catch (InterruptedException e) { + Statics.LOGGER.info("Backup restoration cancelled."); return; }