-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
InventoryAccessRevision.java
53 lines (42 loc) · 1.46 KB
/
InventoryAccessRevision.java
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package xyz.xenondevs.inventoryaccess.version;
import xyz.xenondevs.inventoryaccess.util.VersionUtils;
public enum InventoryAccessRevision {
// this order is required
R19("r19", "1.20.5"),
R18("r18", "1.20.3"),
R17("r17", "1.20.2"),
R16("r16", "1.20.0"),
R15("r15", "1.19.4"),
R14("r14", "1.19.3"),
R13("r13", "1.19.1"),
R12("r12", "1.19.0"),
R11("r11", "1.18.2"),
R10("r10", "1.18.0"),
R9("r9", "1.17.1"),
R8("r8", "1.17.0"),
R7("r7", "1.16.4"),
R6("r6", "1.16.2"),
R5("r5", "1.16.0"),
R4("r4", "1.15.0"),
R3("r3", "1.14.4"),
R2("r2", "1.14.1"),
R1("r1", "1.14.0");
public static final InventoryAccessRevision REQUIRED_REVISION = getRequiredRevision();
private final String packageName;
private final int[] since;
InventoryAccessRevision(String packageName, String since) {
this.packageName = packageName;
this.since = VersionUtils.toMajorMinorPatch(since);
}
private static InventoryAccessRevision getRequiredRevision() {
for (InventoryAccessRevision revision : values())
if (VersionUtils.isServerHigherOrEqual(revision.getSince())) return revision;
throw new UnsupportedOperationException("Your version of Minecraft is not supported by InventoryAccess");
}
public String getPackageName() {
return packageName;
}
public int[] getSince() {
return since;
}
}