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

Commit 2edd1f2

Browse files
committed
api(nms): SERVER_VERSION を追加
1 parent 1a15313 commit 2edd1f2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ repositories {
262262
}
263263
264264
dependencies {
265-
api('com.github.sya-ri:EasySpigotAPI:2.2.4') {
265+
api('com.github.sya-ri:EasySpigotAPI:2.3.0') {
266266
exclude group: 'org.spigotmc', module: 'spigot-api'
267267
}
268268
}
@@ -276,7 +276,7 @@ repositories {
276276
}
277277

278278
dependencies {
279-
api("com.github.sya-ri:EasySpigotAPI:2.2.4") {
279+
api("com.github.sya-ri:EasySpigotAPI:2.3.0") {
280280
exclude(group = "org.spigotmc", module = "spigot-api")
281281
}
282282
}
@@ -302,7 +302,7 @@ configurations {
302302
}
303303
304304
dependencies {
305-
shadowApi('com.github.sya-ri:EasySpigotAPI:2.2.4') {
305+
shadowApi('com.github.sya-ri:EasySpigotAPI:2.3.0') {
306306
exclude group: 'org.spigotmc', module: 'spigot-api'
307307
}
308308
}
@@ -327,7 +327,7 @@ repositories {
327327
}
328328

329329
dependencies {
330-
shadowApi("com.github.sya-ri:EasySpigotAPI:2.2.4") {
330+
shadowApi("com.github.sya-ri:EasySpigotAPI:2.3.0") {
331331
exclude(group = "org.spigotmc", module = "spigot-api")
332332
}
333333
}

api/src/main/kotlin/com/github/syari/spigot/api/nms/extension.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import org.bukkit.Bukkit
88
*/
99
val NMS_VERSION = Bukkit.getServer()::class.java.`package`.name.substring(23)
1010

11+
/**
12+
* サーバーのメジャーバージョン。1.16.5 であれば 16 になる。
13+
* @since 2.3.0
14+
*/
15+
val SERVER_VERSION = NMS_VERSION.split('_')[1].toInt()
16+
1117
/**
1218
* NMS のクラスを取得する。`%s` が [NMS_VERSION] に置き換わる。
1319
* ```

0 commit comments

Comments
 (0)