Devan-Kerman / ARRP

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

[Question] Complex blockstates #8

Closed PssbleTrngle closed 4 years ago

PssbleTrngle commented 4 years ago

How would you generate a blockstate file representing this json?

"variants": {
      "facing": {
         "north": {},
         "south": {"y": 180},
         "west": {"y": 270},
         "east": {"y": 90}
      },
      "spell": {
         "good": { "model": "mischief:totem/totem_basalt_enchanted" },
         "bad": { "model": "mischief:totem/totem_basalt_enchanted" },
         "none": { "model": "mischief:totem/totem_basalt" }
      } 
  }

This is my obviously wrong attempt. model(it) just returns the something like 'modid:block/name'

new JVariant()
    put(SpellableBlock.STATE.name, State.NONE, JBlockModel(model(it).toString()))
    put(SpellableBlock.STATE.name, State.CURSED, JBlockModel(model(it).toString()))
    put(SpellableBlock.STATE.name, State.BLESSED, JBlockModel(model(it).toString()))
    put(Totem.FACING.name, Direction.NORTH, JBlockModel("what").y(0))
    put(Totem.FACING.name, Direction.SOUTH, JBlockModel("what").y(180))
    put(Totem.FACING.name, Direction.WEST, JBlockModel("what").y(270))
    put(Totem.FACING.name, Direction.EAST, JBlockModel("what").y(90))
PssbleTrngle commented 4 years ago

Or would I use a multipart for that?