You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 7, 2024. It is now read-only.
@@ -60,8 +63,16 @@ class BukkitPlugin : PlatformPlugin<BukkitPluginDescription>("Bukkit", "plugin.y
60
63
if (!VALID_NAME.matches(name)) throwInvalidPluginDescriptionException("Invalid plugin name: should match $VALID_NAME")
61
64
if (description.apiVersion !=null) {
62
65
val apiVersion = description.apiVersion!!
63
-
if (!VALID_API_VERSION.matches(apiVersion)) throwInvalidPluginDescriptionException("Invalid api version: should match $VALID_API_VERSION")
64
-
if (apiVersion <"1.13") throwInvalidPluginDescriptionException("Invalid api version: should be at least 1.13")
66
+
val splitVersion = apiVersion.split("\\.").map { v -> v.toInt() }
67
+
if (splitVersion.size ==2) {
68
+
if (!VALID_API_VERSION.matches(apiVersion)) throwInvalidPluginDescriptionException("Invalid api version: should match $VALID_API_VERSION")
69
+
if (apiVersion <"1.13") throwInvalidPluginDescriptionException("Invalid api version: should be at least 1.13")
70
+
} elseif (splitVersion.size ==3) {
71
+
if (splitVersion[1] <20) throwInvalidPluginDescriptionException("Invalid api version: Minor versions are not supported before 1.20.5")
72
+
if (splitVersion[1] ==20&& splitVersion[2] <5) throwInvalidPluginDescriptionException("Invalid api version: Minor versions are not supported before 1.20.5")
73
+
} else {
74
+
throwInvalidPluginDescriptionException("Invalid api version: $VALID_API_VERSION")
75
+
}
65
76
}
66
77
67
78
if (description.version.isNullOrEmpty()) throwInvalidPluginDescriptionException("Plugin version is not set")
0 commit comments