private static int[] parseVersion(String version) {
        String[] elements = version.split("\\.");
        int[] numbers = new int[3];

        // Make sure it's even a valid version
        if (elements.length < 1) {
            throw new IllegalStateException("Corrupt MC version: " + version);
        }

        // The String 1 or 1.2 is interpreted as 1.0.0 and 1.2.0 respectively.
        for (int i = 0; i < Math.min(numbers.length, elements.length); i++) {
            numbers[i] = Integer.parseInt(elements[i].trim());
        }
        return numbers;
    }
Parses a {@link MinecraftVersion} from a version string, in the format
<code>major.minor.build</code>, or in the snapshot format.

@param version the version in text form.
@param parseSnapshot if the implementation should try to parse a snapshot version
@throws IllegalArgumentException if unable to parse
helper/src/main/java/me/lucko/helper/reflect/MinecraftVersion.java