diff --git a/pom.xml b/pom.xml index bf787c43d..6d178dab3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.maxgamer QuickShop - Reremake 1.3.0 [Dev] + Reremake 1.3.0 snapshot diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 87caecc37..a154c81b6 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -15,6 +15,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map.Entry; +import java.util.Scanner; import java.util.UUID; import org.bukkit.Bukkit; @@ -127,6 +128,30 @@ public class QuickShop extends JavaPlugin { @SuppressWarnings("resource") public void onEnable() { + if(Util.isDevEdition()) { + getLogger().severe("WARNING: You are running QSRR unstable test version"); + getLogger().severe("WARNING: Keep backup and DO NOT running on production environment!"); + getLogger().severe("WARNING: Test version may destory anything!"); + getLogger().severe("WARNING: QSRR will start after you confirm, nothing will changes before this alert"); + getLogger().severe("WARNING: Input `qs continue` and press enter to continue load server."); + while(true) { + Scanner s = new Scanner(System.in); + String input = s.nextLine(); + switch (input) { + case "qs continue": + getLogger().severe("Continue..."); + break; + case "qs shutdown": + //Force stop server + getLogger().severe("Force shutting down..."); + System.exit(0); + break; + default: + getLogger().severe("Use `qs continue` to continue load or use `qs shutdown` to force shutdown without changes."); + break; + } + } + } getLogger().info("Quickshop Reremake by Ghost_chu(Minecraft SunnySide Server Community)"); getLogger().info("THIS VERSION ONLY SUPPORT BUKKIT API 1.13-1.13.x VERSION!"); getLogger().info("Author:Ghost_chu"); diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 01c489eb6..1fd84cbc6 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -747,5 +747,13 @@ public class Util { public static void sendDeprecatedMethodWarn() { QuickShop.instance.getLogger().warning("Some plugin calling Deprecated method, Please contact author to use new api!"); } + + public static boolean isDevEdition() { + if(QuickShop.instance.getDescription().getVersion().contains("dev")||QuickShop.instance.getDescription().getVersion().contains("alpha")||QuickShop.instance.getDescription().getVersion().contains("beta")||QuickShop.instance.getDescription().getVersion().contains("snapshot")) { + return true; + }else { + return false; + } + } }