LiteLoaderVersion.java
1.57 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.mumfrey.liteloader.core;
import java.util.HashSet;
import java.util.Set;
/**
* LiteLoader version table
*
* @author Adam Mummery-Smith
* @version 1.6.2
*/
public enum LiteLoaderVersion
{
LEGACY(0, "-", "-", "-"),
MC_1_6_1_R0(11, "1.6.1", "1.6.1", "1.6.1", "1.6.r1"),
MC_1_6_2_R0(12, "1.6.2", "1.6.2", "1.6.2", "1.6.r2");
private int revision;
private String minecraftVersion;
private String loaderVersion;
private Set<String> supportedVersions = new HashSet<String>();
private LiteLoaderVersion(int revision, String minecraftVersion, String loaderVersion, String... supportedVersions)
{
this.revision = revision;
this.minecraftVersion = minecraftVersion;
this.loaderVersion = loaderVersion;
for (String supportedVersion : supportedVersions)
this.supportedVersions.add(supportedVersion);
}
public int getLoaderRevision()
{
return this.revision;
}
public String getMinecraftVersion()
{
return this.minecraftVersion;
}
public String getLoaderVersion()
{
return this.loaderVersion;
}
public static LiteLoaderVersion getVersionFromRevision(int revision)
{
for (LiteLoaderVersion version : LiteLoaderVersion.values())
{
if (version.getLoaderRevision() == revision)
return version;
}
return LiteLoaderVersion.LEGACY;
}
public boolean isVersionSupported(String version)
{
return this.supportedVersions.contains(version);
}
@Override
public String toString()
{
return this == LiteLoaderVersion.LEGACY ? "Unknown" : this.loaderVersion;
}
}