Skip to content

Commit

Permalink
Close #38
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoPangxie732 committed Feb 1, 2022
1 parent 0c5a472 commit 40cfb8e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import cn.maxpixel.mcdecompiler.mapping1.type.MappingType;
import cn.maxpixel.mcdecompiler.reader.ClassifiedMappingReader;
import cn.maxpixel.mcdecompiler.util.*;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import it.unimi.dsi.fastutil.objects.Object2ObjectMaps;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectList;
Expand Down Expand Up @@ -188,8 +190,11 @@ private void preprocess(Path inputJar) {
libs.add(extractDir.resolve(lib.getFileName().toString()));
});
this.bundledLibs = Optional.of(libs);
} else {
this.inputJar = inputJar;
} else this.inputJar = inputJar;
Path versionJson = jarFs.getPath("/version.json");
if(version == null && Files.exists(versionJson)) {
JsonObject object = JsonParser.parseString(Files.readString(versionJson)).getAsJsonObject();
this.version = object.get("id").getAsString();
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error opening jar file {0}", new Object[] {inputJar, e});
Expand Down

0 comments on commit 40cfb8e

Please sign in to comment.