mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-01 00:10:32 +01:00
Write NMSVersion parsing special case for FakeServer.
This commit is contained in:
parent
50f2e7a95f
commit
9963476218
@ -234,7 +234,13 @@ public class ReflUtil {
|
||||
public static NMSVersion fromString(String string) {
|
||||
Preconditions.checkNotNull(string, "string cannot be null.");
|
||||
Matcher matcher = VERSION_PATTERN.matcher(string);
|
||||
if (!matcher.matches()) {
|
||||
if (!Bukkit.getName().equals("Essentials Fake Server")) {
|
||||
throw new IllegalArgumentException(string + " is not in valid version format. e.g. v1_10_R1");
|
||||
}
|
||||
matcher = VERSION_PATTERN.matcher(V1_12_R1.toString());
|
||||
Preconditions.checkArgument(matcher.matches(), string + " is not in valid version format. e.g. v1_10_R1");
|
||||
}
|
||||
return new NMSVersion(Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)), Integer.parseInt(matcher.group(3)));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user