From a3a47d4808d4b87a53fdb304c142889da7e823fa Mon Sep 17 00:00:00 2001 From: MrTron Date: Fri, 8 Jul 2022 22:40:23 -0400 Subject: [PATCH] 1.2 -Add Nicer Logging System --- pom.xml | 2 +- src/main/java/com/tronmc/beta/amend/Amend.java | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index fab7866..8e03cc0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.tronmc.beta Amend - 1.1.2--V.1.19 + 1.2--V.1.19 jar Amend diff --git a/src/main/java/com/tronmc/beta/amend/Amend.java b/src/main/java/com/tronmc/beta/amend/Amend.java index a081b54..9643f3e 100644 --- a/src/main/java/com/tronmc/beta/amend/Amend.java +++ b/src/main/java/com/tronmc/beta/amend/Amend.java @@ -9,6 +9,7 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.util.Scanner; +import java.util.concurrent.TimeUnit; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -19,7 +20,7 @@ public final class Amend extends JavaPlugin { @Override public void onEnable() { - Bukkit.getLogger().info("Amend is on standby, ready for updates on shutdown."); + getLogger().info("Amend is on standby, ready for updates on shutdown."); } @@ -56,10 +57,23 @@ public void onDisable() { Files.copy(in, Paths.get("purpur.jar"), StandardCopyOption.REPLACE_EXISTING); Bukkit.getLogger().info("Update Completed!"); Bukkit.getLogger().warning("-------------------------------"); + try { + TimeUnit.SECONDS.sleep(3); + } catch (InterruptedException e) { + e.printStackTrace(); + } + getLogger().info("Successfully updated & disabled Amend!"); } else { Bukkit.getLogger().info("Server is up to date!"); Bukkit.getLogger().info("Closing plugin..."); Bukkit.getLogger().warning("-------------------------------"); + try { + TimeUnit.SECONDS.sleep(3); + } catch (InterruptedException e) { + e.printStackTrace(); + } + getLogger().info("Successfully disabled Amend!"); + } } catch (IOException e) { e.printStackTrace();