public static final int parseRevision(String version) {
   if (version == null) {
     return 0;
   }
   if (version.startsWith("KoLmafia r")) {
     version = version.substring(10);
   }
   return StringUtilities.isNumeric(version) ? StringUtilities.parseInt(version) : 0;
 }
  public static final int getRevision() {
    if (KoLConstants.REVISION == null) {
      return 0;
    }

    int colonIndex = KoLConstants.REVISION.indexOf(":");
    String revision = KoLConstants.REVISION;
    if (colonIndex != -1) {
      revision = KoLConstants.REVISION.substring(0, colonIndex);
    } else if (KoLConstants.REVISION.endsWith("M")) {
      revision = KoLConstants.REVISION.substring(0, KoLConstants.REVISION.length() - 1);
    }

    return StringUtilities.isNumeric(revision) ? StringUtilities.parseInt(revision) : 0;
  }