MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / parseGlVersion

Method parseGlVersion

src/main/java/net/minecraft/src/Config.java:293–315  ·  view source on GitHub ↗
(String p_parseGlVersion_0_, GlVersion p_parseGlVersion_1_)

Source from the content-addressed store, hash-verified

291 }
292
293 public static GlVersion parseGlVersion(String p_parseGlVersion_0_, GlVersion p_parseGlVersion_1_) {
294 try {
295 if (p_parseGlVersion_0_ == null) {
296 return p_parseGlVersion_1_;
297 } else {
298 Pattern pattern = Pattern.compile("([0-9]+)\\.([0-9]+)(\\.([0-9]+))?(.+)?");
299 Matcher matcher = pattern.matcher(p_parseGlVersion_0_);
300
301 if (!matcher.matches()) {
302 return p_parseGlVersion_1_;
303 } else {
304 int i = Integer.parseInt(matcher.group(1));
305 int j = Integer.parseInt(matcher.group(2));
306 int k = matcher.group(4) != null ? Integer.parseInt(matcher.group(4)) : 0;
307 String s = matcher.group(5);
308 return new GlVersion(i, j, k, s);
309 }
310 }
311 } catch (Exception exception) {
312 exception.printStackTrace();
313 return p_parseGlVersion_1_;
314 }
315 }
316
317 public static String[] getOpenGlExtensions() {
318 if (openGlExtensions == null) {

Callers 2

getGlVersionMethod · 0.95
getGlslVersionMethod · 0.95

Calls 2

matchesMethod · 0.65
parseIntMethod · 0.45

Tested by

no test coverage detected