Devan-Kerman / ARRP

A fabric api for creating resources and assets at runtime
Mozilla Public License 2.0
101 stars 25 forks source link

BlockState multi-variant serialization is completely incorrect #32

Closed Leo40Git closed 3 years ago

Leo40Git commented 3 years ago

Example:

import static net.devtech.arrp.json.blockstate.JState.*;

state().add(variant()
  .put("ready", false, model("yo:block/machine"))
  .put("ready", true, model("yo:block/machine_ready"))
)

What it currently outputs as:

{
  "variants": [
    {
      "ready=false": {
        "model": "yo:block/machine"
      }
    },
    {
      "ready=true": {
        "model": "yo:block/machine_ready"
      }
    }
  ]
}

What it should output:

{
  "variants": {
    "ready=false": {
      "model": "yo:block/machine"
    },
    "ready=true": {
      "model": "yo:block/machine_ready"
    }
}
Devan-Kerman commented 3 years ago

it's technically not incorrect because it works :tiny_potato:, however when there's only one variant it should use the non-list serializing, will do

Devan-Kerman commented 3 years ago

wait no, it already does that, are you using an old version of ARRP

Leo40Git commented 3 years ago

honestly this is a report from someone else and I can't believe I forgot to ask them what version of ARRP they were using so uh. I'll try to track them down and yell at them

Devan-Kerman commented 3 years ago

yea your example seems to work just fine in test

Leo40Git commented 3 years ago

Person has been yelled at, closing this. Sorry!

Devan-Kerman commented 3 years ago

np

duplexsystem commented 2 years ago

I am having this issue on 0.5.3.