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

Method compareRelease

src/main/java/net/minecraft/src/Config.java:1341–1372  ·  view source on GitHub ↗
(String p_compareRelease_0_, String p_compareRelease_1_)

Source from the content-addressed store, hash-verified

1339 }
1340
1341 public static int compareRelease(String p_compareRelease_0_, String p_compareRelease_1_) {
1342 String[] astring = splitRelease(p_compareRelease_0_);
1343 String[] astring1 = splitRelease(p_compareRelease_1_);
1344 String s = astring[0];
1345 String s1 = astring1[0];
1346
1347 if (!s.equals(s1)) {
1348 return s.compareTo(s1);
1349 } else {
1350 int i = parseInt(astring[1], -1);
1351 int j = parseInt(astring1[1], -1);
1352
1353 if (i != j) {
1354 return i - j;
1355 } else {
1356 String s2 = astring[2];
1357 String s3 = astring1[2];
1358
1359 if (!s2.equals(s3)) {
1360 if (s2.isEmpty()) {
1361 return 1;
1362 }
1363
1364 if (s3.isEmpty()) {
1365 return -1;
1366 }
1367 }
1368
1369 return s2.compareTo(s3);
1370 }
1371 }
1372 }
1373
1374 private static String[] splitRelease(String p_splitRelease_0_) {
1375 if (p_splitRelease_0_ != null && !p_splitRelease_0_.isEmpty()) {

Callers 1

checkCompatibleMethod · 0.95

Calls 5

splitReleaseMethod · 0.95
parseIntMethod · 0.95
equalsMethod · 0.45
compareToMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected