From 8e5279d720dc8042c5abbe9161d64918efe7cb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Fri, 8 Jun 2018 23:00:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/me/skymc/taboolib/TabooLib.java | 20 ++++++++++++------- .../commands/taboolib/CycleInfoCommand.java | 2 +- .../commands/taboolib/CycleResetCommand.java | 2 +- .../commands/taboolib/CycleUpdateCommand.java | 2 +- .../commands/taboolib/ShellLoadCommand.java | 2 +- .../commands/taboolib/ShellUnloadCommand.java | 2 +- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index e89eeb8..59b125b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.skymc TabooLib - 4.08 + 4.09 UTF-8 diff --git a/src/main/java/me/skymc/taboolib/TabooLib.java b/src/main/java/me/skymc/taboolib/TabooLib.java index 1e3c84c..9ae1e60 100644 --- a/src/main/java/me/skymc/taboolib/TabooLib.java +++ b/src/main/java/me/skymc/taboolib/TabooLib.java @@ -45,6 +45,10 @@ public class TabooLib { return Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; } + public static int getVersionNumber() { + return getVerint(); + } + public static String getServerUID() { if (!DataUtils.getPluginData("TabooLibrary", null).contains("serverUID")) { DataUtils.getPluginData("TabooLibrary", null).set("serverUID", UUID.randomUUID().toString()); @@ -56,20 +60,22 @@ public class TabooLib { DataUtils.getPluginData("TabooLibrary", null).set("serverUID", UUID.randomUUID().toString()); } + @Deprecated public static int getVerint() { - if (getVersion().startsWith("v1_7")) { + String version = getVersion(); + if (version.startsWith("v1_7")) { return 10700; - } else if (getVersion().startsWith("v1_8")) { + } else if (version.startsWith("v1_8")) { return 10800; - } else if (getVersion().startsWith("v1_9")) { + } else if (version.startsWith("v1_9")) { return 10900; - } else if (getVersion().startsWith("v1_10")) { + } else if (version.startsWith("v1_10")) { return 11000; - } else if (getVersion().startsWith("v1_11")) { + } else if (version.startsWith("v1_11")) { return 11100; - } else if (getVersion().startsWith("v1_12")) { + } else if (version.startsWith("v1_12")) { return 11200; - } else if (getVersion().startsWith("v1_13")) { + } else if (version.startsWith("v1_13")) { return 11300; } return 0; diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleInfoCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleInfoCommand.java index 6ddacae..6307c0c 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleInfoCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleInfoCommand.java @@ -13,7 +13,7 @@ public class CycleInfoCommand extends SubCommand { public CycleInfoCommand(CommandSender sender, String[] args) { super(sender, args); - if (args.length < 3) { + if (args.length < 2) { TLocale.sendTo(sender, "COMMANDS.PARAMETER.UNKNOWN"); return; } diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleResetCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleResetCommand.java index 9816e72..5af4875 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleResetCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleResetCommand.java @@ -16,7 +16,7 @@ public class CycleResetCommand extends SubCommand { public CycleResetCommand(CommandSender sender, String[] args) { super(sender, args); - if (args.length < 3) { + if (args.length < 2) { TLocale.sendTo(sender, "COMMANDS.PARAMETER.UNKNOWN"); return; } diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleUpdateCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleUpdateCommand.java index ad646da..ad2ff66 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/CycleUpdateCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/CycleUpdateCommand.java @@ -15,7 +15,7 @@ public class CycleUpdateCommand extends SubCommand { public CycleUpdateCommand(CommandSender sender, String[] args) { super(sender, args); - if (args.length < 3) { + if (args.length < 2) { TLocale.sendTo(sender, "COMMANDS.PARAMETER.UNKNOWN"); return; } diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/ShellLoadCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/ShellLoadCommand.java index 3b82d16..d8e87eb 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/ShellLoadCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/ShellLoadCommand.java @@ -11,7 +11,7 @@ public class ShellLoadCommand extends SubCommand { public ShellLoadCommand(CommandSender sender, String[] args) { super(sender, args); - if (args.length < 3) { + if (args.length < 2) { TLocale.sendTo(sender, "COMMANDS.TABOOLIB.JAVASHELL.INVALID-NAME"); return; } diff --git a/src/main/java/me/skymc/taboolib/commands/taboolib/ShellUnloadCommand.java b/src/main/java/me/skymc/taboolib/commands/taboolib/ShellUnloadCommand.java index 17c7628..995ae2b 100644 --- a/src/main/java/me/skymc/taboolib/commands/taboolib/ShellUnloadCommand.java +++ b/src/main/java/me/skymc/taboolib/commands/taboolib/ShellUnloadCommand.java @@ -11,7 +11,7 @@ public class ShellUnloadCommand extends SubCommand { public ShellUnloadCommand(CommandSender sender, String[] args) { super(sender, args); - if (args.length < 3) { + if (args.length < 2) { TLocale.sendTo(sender, "COMMANDS.TABOOLIB.JAVASHELL.INVALID-NAME"); return; }