From 609b42d5c9eb1bc6eefa83735c5606c77bd0ff9e Mon Sep 17 00:00:00 2001
From: Ghost_chu <2908803755@qq.com>
Date: Sat, 27 Oct 2018 13:23:56 +0800
Subject: [PATCH] ready build
Former-commit-id: 5e432339bedede721930f8306250d52989919e87
---
pom.xml | 2 +-
.../org/maxgamer/quickshop/QuickShop.java | 25 +++++++++++++++++++
.../org/maxgamer/quickshop/Util/Util.java | 8 ++++++
3 files changed, 34 insertions(+), 1 deletion(-)
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;
+ }
+ }
}