diff --git a/src/main/kotlin/lirand/api/extensions/server/ServerExtensions.kt b/src/main/kotlin/lirand/api/extensions/server/ServerExtensions.kt index 5760e92..7231ffa 100644 --- a/src/main/kotlin/lirand/api/extensions/server/ServerExtensions.kt +++ b/src/main/kotlin/lirand/api/extensions/server/ServerExtensions.kt @@ -6,8 +6,11 @@ import org.bukkit.WorldCreator val server get() = Bukkit.getServer() -val nmsVersion = server.javaClass.getPackage().name - .split(".")[3].substring(1) +val nmsVersion = if (server.javaClass.getPackage().name.split(".").size > 3) { + server.javaClass.getPackage().name.split(".")[3].substring(1) +} else { + "" // default value +} val splitNmsVersion = nmsVersion.split("_") val nmsNumberVersion: Int = if (splitNmsVersion.size > 1) {