Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Commit

Permalink
api(nms): SERVER_VERSION を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sya-ri committed Apr 3, 2021
1 parent 1a15313 commit 2edd1f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ repositories {
}
dependencies {
api('com.github.sya-ri:EasySpigotAPI:2.2.4') {
api('com.github.sya-ri:EasySpigotAPI:2.3.0') {
exclude group: 'org.spigotmc', module: 'spigot-api'
}
}
Expand All @@ -276,7 +276,7 @@ repositories {
}

dependencies {
api("com.github.sya-ri:EasySpigotAPI:2.2.4") {
api("com.github.sya-ri:EasySpigotAPI:2.3.0") {
exclude(group = "org.spigotmc", module = "spigot-api")
}
}
Expand All @@ -302,7 +302,7 @@ configurations {
}
dependencies {
shadowApi('com.github.sya-ri:EasySpigotAPI:2.2.4') {
shadowApi('com.github.sya-ri:EasySpigotAPI:2.3.0') {
exclude group: 'org.spigotmc', module: 'spigot-api'
}
}
Expand All @@ -327,7 +327,7 @@ repositories {
}

dependencies {
shadowApi("com.github.sya-ri:EasySpigotAPI:2.2.4") {
shadowApi("com.github.sya-ri:EasySpigotAPI:2.3.0") {
exclude(group = "org.spigotmc", module = "spigot-api")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import org.bukkit.Bukkit
*/
val NMS_VERSION = Bukkit.getServer()::class.java.`package`.name.substring(23)

/**
* サーバーのメジャーバージョン。1.16.5 であれば 16 になる。
* @since 2.3.0
*/
val SERVER_VERSION = NMS_VERSION.split('_')[1].toInt()

/**
* NMS のクラスを取得する。`%s` が [NMS_VERSION] に置き換わる。
* ```
Expand Down

0 comments on commit 2edd1f2

Please sign in to comment.