RandomMcSomethin / fallingleaves

MIT License
43 stars 20 forks source link

Invalid JSON format of fabric.mod.json #36

Closed Stefan99353 closed 2 years ago

Stefan99353 commented 2 years ago

I just encountered a problem while parsing this mods fabric.mod.json file. The description field is a multi-line string when extracting the jar file.

As far as I know, this is not valid JSON:

{
  "schemaVersion": 1,
  "id": "fallingleaves",
  "version": "1.12.1+1.19",
  "name": "Falling Leaves",
  "description": "\"How the gentle wind 
beckons through the leaves 
as autumn colors fall,
dancing in a swirl 
of golden memories:
the loveliest lies of all.\"",
  "authors": [
    "Fourmisain",
    "BrekiTomasson",
    "RandomMcSomethin"
  ],
  "contact": {
    "homepage": "https://www.curseforge.com/minecraft/mc-mods/falling-leaves-fabric",
    "issues": "https://github.com/RandomMcSomethin/fallingleaves/issues",
    "sources": "https://github.com/RandomMcSomethin/fallingleaves"
  },
  "license": "MIT",
  "icon": "assets/fallingleaves/icon.png",
  "environment": "client",
  "entrypoints": {
    "client": [
      "randommcsomethin.fallingleaves.FallingLeavesClient"
    ],
    "modmenu": [
      "randommcsomethin.fallingleaves.config.gui.FallingLeavesMenu"
    ]
  },
  "mixins": [
    "fallingleaves.mixins.json"
  ],
  "depends": {
    "fabricloader": ">=0.14.6",
    "fabric": "*",
    "minecraft": ">=1.19.0",
    "cloth-config2": ">=6.0.0",
    "java": ">=17"
  }
}

I inspected the source code and found that those line-breaks are not there. They are represented using \n characters.

Is this an error during build or is it meant to be like that?

Fourmisain commented 2 years ago

It's the the copy task's expand that does it, luckily this has already been reported as an issue and an escapeBackslash setting was added in Gradle 7.2 so it's a really easy fix.

I wanted to do new release for a while now, so this is a good point for a patch release.