9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-19 15:09:25 +00:00

fix compatibility

This commit is contained in:
XiaoMoMi
2025-05-26 19:58:29 +08:00
parent 665f4142ad
commit d3fcdbcd94
6 changed files with 21 additions and 9 deletions

View File

@@ -118,6 +118,18 @@ public class VersionHelper {
return mojmap;
}
public static int getVersion(String version) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < version.length(); i++) {
char ch = version.charAt(i);
if (ch >= '0' && ch <= '9') {
builder.append(ch);
break;
}
}
return Integer.parseInt(builder.toString());
}
// Method to compare two version strings
private static boolean compareVer(String newV, String currentV) {
if (newV == null || currentV == null || newV.isEmpty() || currentV.isEmpty()) {