Blockception / BC-Minecraft-Bedrock-Diagnoser

A typescript package library that provides diagnostics for Minecraft bedrock projects
https://www.npmjs.com/package/bc-minecraft-bedrock-diagnoser
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Floats are completely lost after Json.LoadReport<>() #267

Closed Xterionix closed 1 month ago

Xterionix commented 1 month ago
"paeaefae:aeae": {
    "type": "float",
    "default": 3.2,
    "range": [ 0.0, 2.0 ]
}

When read by the diagnoser, the default value for this actor property is 3. Just logging jsonc.prase(diagnoser.document) contains the 3.2 value.

Most likely happens in other places too, but this is where I noticed it

Xterionix commented 1 month ago

@DaanV2 Thoughts?

DaanV2 commented 1 month ago

I mean if its wrong, it should be updated. Im unsure what you want to gauge 🤔

Xterionix commented 1 month ago

I was hoping you'd have an idea on how it can be fixed, something I could work off of. Since it seems like the type cast is where the data is lost

DaanV2 commented 1 month ago

Looked into it, but nothing is turning it to 3, where are you finding this?

Xterionix commented 1 month ago

Can you check the entity property pr? Just run the diagnoser with an entity that has float properties like that, and you'll get an error saying "Expected float property: 3"

DaanV2 commented 1 month ago

I ran it with the latest extension, and the only error I'm getting is:

Default value is not within the range: 3.2
Xterionix commented 1 month ago

That's odd, it must be something with my system's environment then. Either way this isn't an issue then and the pr can be merged