diff options
Diffstat (limited to 'src/cuchaz/enigma/ConvertMain.java')
| -rw-r--r-- | src/cuchaz/enigma/ConvertMain.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/cuchaz/enigma/ConvertMain.java b/src/cuchaz/enigma/ConvertMain.java index 17bd2f8..068fe5b 100644 --- a/src/cuchaz/enigma/ConvertMain.java +++ b/src/cuchaz/enigma/ConvertMain.java | |||
| @@ -42,19 +42,21 @@ public class ConvertMain { | |||
| 42 | throws IOException, MappingParseException { | 42 | throws IOException, MappingParseException { |
| 43 | 43 | ||
| 44 | // init files | 44 | // init files |
| 45 | String inVer = "1.8.3"; | ||
| 46 | String outVer = "1.8.8"; | ||
| 45 | File home = new File(System.getProperty("user.home")); | 47 | File home = new File(System.getProperty("user.home")); |
| 46 | JarFile sourceJar = new JarFile(new File(home, ".minecraft/versions/1.8/1.8.jar")); | 48 | JarFile sourceJar = new JarFile(new File(home, ".minecraft/versions/" + inVer + "/" + inVer + ".jar")); |
| 47 | JarFile destJar = new JarFile(new File(home, ".minecraft/versions/1.8.3/1.8.3.jar")); | 49 | JarFile destJar = new JarFile(new File(home, ".minecraft/versions/" + outVer + "/" + outVer + ".jar")); |
| 48 | File inMappingsFile = new File("../Enigma Mappings/1.8.mappings"); | 50 | File inMappingsFile = new File("../minecraft-mappings/" + inVer + ".mappings"); |
| 49 | File outMappingsFile = new File("../Enigma Mappings/1.8.3.mappings"); | 51 | File outMappingsFile = new File("../minecraft-mappings/" + outVer + ".mappings"); |
| 50 | Mappings mappings = new MappingsReader().read(new FileReader(inMappingsFile)); | 52 | Mappings mappings = new MappingsReader().read(new FileReader(inMappingsFile)); |
| 51 | File classMatchesFile = new File(inMappingsFile.getName() + ".class.matches"); | 53 | File classMatchesFile = new File(inVer + "to" + outVer + ".class.matches"); |
| 52 | File fieldMatchesFile = new File(inMappingsFile.getName() + ".field.matches"); | 54 | File fieldMatchesFile = new File(inVer + "to" + outVer + ".field.matches"); |
| 53 | File methodMatchesFile = new File(inMappingsFile.getName() + ".method.matches"); | 55 | File methodMatchesFile = new File(inVer + "to" + outVer + ".method.matches"); |
| 54 | 56 | ||
| 55 | // match classes | 57 | // match classes |
| 56 | //computeClassMatches(classMatchesFile, sourceJar, destJar, mappings); | 58 | //computeClassMatches(classMatchesFile, sourceJar, destJar, mappings); |
| 57 | //editClasssMatches(classMatchesFile, sourceJar, destJar, mappings); | 59 | editClasssMatches(classMatchesFile, sourceJar, destJar, mappings); |
| 58 | //convertMappings(outMappingsFile, sourceJar, destJar, mappings, classMatchesFile); | 60 | //convertMappings(outMappingsFile, sourceJar, destJar, mappings, classMatchesFile); |
| 59 | 61 | ||
| 60 | // match fields | 62 | // match fields |
| @@ -65,7 +67,7 @@ public class ConvertMain { | |||
| 65 | // match methods/constructors | 67 | // match methods/constructors |
| 66 | //computeMethodMatches(methodMatchesFile, destJar, outMappingsFile, classMatchesFile); | 68 | //computeMethodMatches(methodMatchesFile, destJar, outMappingsFile, classMatchesFile); |
| 67 | //editMethodMatches(sourceJar, destJar, outMappingsFile, mappings, classMatchesFile, methodMatchesFile); | 69 | //editMethodMatches(sourceJar, destJar, outMappingsFile, mappings, classMatchesFile, methodMatchesFile); |
| 68 | convertMappings(outMappingsFile, sourceJar, destJar, mappings, classMatchesFile, fieldMatchesFile, methodMatchesFile); | 70 | //convertMappings(outMappingsFile, sourceJar, destJar, mappings, classMatchesFile, fieldMatchesFile, methodMatchesFile); |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | private static void computeClassMatches(File classMatchesFile, JarFile sourceJar, JarFile destJar, Mappings mappings) | 73 | private static void computeClassMatches(File classMatchesFile, JarFile sourceJar, JarFile destJar, Mappings mappings) |