-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathCompatUtil.java
More file actions
38 lines (29 loc) · 904 Bytes
/
CompatUtil.java
File metadata and controls
38 lines (29 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package me.realized.tokenmanager.util.compat;
import me.realized.tokenmanager.util.NumberUtil;
import org.bukkit.Bukkit;
public final class CompatUtil {
private static final long SUB_VERSION;
static {
final String packageName = Bukkit.getServer().getBukkitVersion().split("\\.")[1];
SUB_VERSION = NumberUtil.parseLong(packageName.replace("-R0", "")).orElse(0);
}
private CompatUtil() {}
public static boolean isAfter1_20() {
return SUB_VERSION > 20;
}
public static boolean isPre1_17() {
return SUB_VERSION < 17;
}
public static boolean isPre1_14() {
return SUB_VERSION < 14;
}
public static boolean isPre1_13() {
return SUB_VERSION < 13;
}
public static boolean isPre1_12() {
return SUB_VERSION < 12;
}
public static boolean isPre1_9() {
return SUB_VERSION < 9;
}
}