Comments (4)
Hm... This is quite confusing.
So the reason why the schemaVersion
turned into 1.0
is because of the way this mod is built.
It's actually 3 separate builds that get merged with a plugin I call Glue. One thing Glue does is merge the different fabric.mod.json
s by reading them via Gson, merging the resulting Map
and writing one output file via Gson again.
Gson by default interprets all numbers as double values, hence the 1 is then written as 1.0.
I've now fixed this by giving Gson the ToNumberPolicy.LONG_OR_DOUBLE
policy, which will parse the 1 as a long and hence write it as a 1 again.
Now to the confusing bit:
According to https://json-schema.org/understanding-json-schema/reference/numeric.html
The integer type is used for integral numbers. JSON does not have distinct types for integers and floating-point values. Therefore, the presence or absence of a decimal point is not enough to distinguish between integers and non-integers. For example, 1 and 1.0 are two ways to represent the same value in JSON. JSON Schema considers that value an integer no matter which representation was used.
Hence I do not understand why Quilt produces
MalformedSyntaxException: Found potentially valid JSON5, but invalid JSON while in strict mode $.schemaVersion
Looking into the code, it seems to come down to this line:
The parser only allows for trailing decimals in JSON5 mode.
This seems to have been introduced in QuiltMC/quilt-json5@ccfa242
A strict JSON only mode has been added which will only parse valid JSON.
I've looked a bit further into this and found the JSON standard - well, actually the 3 of them: RFC 8259 , ECMA-404 and ISO/IEC 21778:2017. They are extremely short and reading them makes it very clear, that there is indeed no such thing as an integer, hence I think Quilt's JsonReader
is in the wrong here and should probably be patched.
from creativeonepunch.
New version works as intended
from creativeonepunch.
why this issue is closed? there is no new version
from creativeonepunch.
A new version has been published on Modrinth with the same version number as on CF, but the CF version is actually an older build.
from creativeonepunch.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from creativeonepunch.