Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to read mcmod.info with multiline strings #2

Closed
jamierocks opened this issue Apr 20, 2020 · 0 comments
Closed

Fails to read mcmod.info with multiline strings #2

jamierocks opened this issue Apr 20, 2020 · 0 comments
Assignees
Labels
k: bug Something isn't working m: forge

Comments

@jamierocks
Copy link
Contributor

jamierocks commented Apr 20, 2020

Minecraft Forge uses GSON to read mcmod.info files, which unfortunately allows for multi-line strings to be used - for example, take the following from the Chisel mod (shortened down).

[{
  "credits": "AUTOMATIC_MAIDEN for the original mod,
asie for porting to 1.7.2,
and Pokenfenn/Cricket for continuing it in 1.7.
This mod uses textures from the Painterly Pack: http://painterlypack.net/."
}]

Go's encoding/json library does not accept JSON input, throwing an error - specifically invalid character '\n' in string literal.

EDIT: See the Stackoverflow question for potential solutions.

@jamierocks jamierocks added k: bug Something isn't working m: forge labels Apr 20, 2020
@jamierocks jamierocks self-assigned this Apr 20, 2020
jamierocks added a commit that referenced this issue Apr 20, 2020
There is 2 benefits to using jsonparser:
1. We can read from files with multi-line strings (GH-2)
2. We can handle errors better, giving an actual error - as we're able to
   determine which format is in use.

Signed-off-by: Jamie Mansfield <jmansfield@cadixdev.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k: bug Something isn't working m: forge
Projects
None yet
Development

No branches or pull requests

1 participant