Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unindex recipes and materials #22

Open
rom1504 opened this issue May 7, 2015 · 3 comments
Open

Unindex recipes and materials #22

rom1504 opened this issue May 7, 2015 · 3 comments

Comments

@rom1504
Copy link
Member

rom1504 commented May 7, 2015

Not having an index in json files makes it easier for users to index by what they need. That means the data doesn't have to change if one index or an other becomes more pratical (id vs id:metadata vs name ,... ). It also makes it possible to consider one element as a document of a database.

All json files are now unindexed except for recipes and materials.

I think materials could have a format like this :

{
  "material":"rock",
  "multipliers":  {
    "257": 6,
    "270": 2,
    "274": 4,
    "278": 8,
    "285": 12
  }
}

I'm not sure whether multipliers should be unindexed too since it only has one value, maybe.

The recipes file is currently indexed by output id. The simplest solution might be to just remove that indexing, and to say that the recipes should be ordered by a lexicographic order on (id,metadata) in order to have a decent diff.

@Xstoudi
Copy link

Xstoudi commented Jan 14, 2016

Please specify on the documentation what are

"257": 6,
"270": 2,
"274": 4,
"278": 8,
"285": 12

It isn't obvious...

@rom1504
Copy link
Member Author

rom1504 commented Jan 14, 2016

they are the tool multipliers (see https://github.com/PrismarineJS/prismarine-block/blob/master/index.js#L66) but yeah you're right that should probably go in a doc

@Xstoudi
Copy link

Xstoudi commented Jan 14, 2016

Yep, I understood by finding this issue, thanks :)
And yeah by the way, this format seems good:

{
  "material":"rock",
  "multipliers":  {
    "257": 6,
    "270": 2,
    "274": 4,
    "278": 8,
    "285": 12
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants