This commit is contained in:
坏黑 2018-06-08 23:00:28 +08:00
parent 2c61f793f7
commit 8e5279d720
7 changed files with 19 additions and 13 deletions

View File

@ -6,7 +6,7 @@
<groupId>me.skymc</groupId>
<artifactId>TabooLib</artifactId>
<version>4.08</version>
<version>4.09</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}