Skip to content

Commit

Permalink
fix bad read of pack.mcmeta
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryBorek committed Oct 13, 2024
1 parent 9c184a9 commit 37c6fbe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ForwardsPackConverter extends PackConverter {

public ForwardsPackConverter(String from, String to, String light, boolean minify, Path input, boolean debug,
PrintStream out) {
GsonBuilder gsonBuilder = new GsonBuilder().disableHtmlEscaping().setLenient();
GsonBuilder gsonBuilder = new GsonBuilder().setLenient();
if (!minify)
gsonBuilder.setPrettyPrinting();
gson = gsonBuilder.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ else if (to >= Util.getVersionProtocol(packConverter.getGson(), "1.7.2")
versionInt = 0;

JsonObject json = JsonUtil.readJson(packConverter.getGson(), file);

This comment has been minimized.

if (json == null) {
json = new JsonObject();
}

{
JsonObject meta = json.getAsJsonObject("meta");
if (meta == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static boolean isJson(Gson gson, String Json) {
gson.fromJson(Json, Object.class);
return true;
} catch (com.google.gson.JsonSyntaxException ex) {
ex.printStackTrace();
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.9</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
Expand Down

0 comments on commit 37c6fbe

Please sign in to comment.