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

Revert "Adding Minecraft Item Browser project" #345

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

njt1982
Copy link
Contributor

@njt1982 njt1982 commented Nov 14, 2020

Reverts #329

Hi - quick PR to remove the link... I no longer use Prismarine for a data source; I'm parsing the JAR file manually.

The combination of #290 and #330 meant that I was missing a lot of useful recipe data. I honestly tried to find a way to get the data into the toolchain for this dataset, but I couldn't figure out what I needed to change and where.... (combined with the Burger project resisting adding more recipes).

Thanks for all the help with the data.

@rom1504
Copy link
Member

rom1504 commented Nov 14, 2020 via email

@njt1982
Copy link
Contributor Author

njt1982 commented Nov 16, 2020

It parses data in the JAR into JSON in a very similar structure to Prismarine...

Script:
https://github.com/njt1982/minecraft-item-browser/blob/master/scripts/parse_jar.js

Output (items / recipes / titles):
https://github.com/njt1982/minecraft-item-browser/tree/master/public/js

I essentially had the site working under Prismarine as I needed but it was simply missing data around recipes for things like Smelting... Originally I used this update.js script which is super simple; it basically copied the data out and massaged it slightly for my needs.

Items get parsed into structures like this:

{
  "id":0,
  "name":"acacia_planks",
  "displayName":"Acacia Planks",
  "texture":"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA1ElEQVQ4y4VTIRICQQzLcxgwDAaJxCBQOBSaf5xD4/gAH0DysWWyM9kJoYDodbftbJs0h8dp3e7HVaN/njcf9it+3S8aeNAjNAZvh+V4NPO6s4aGqlBeRbJ8pE/Az2U378az7tN21k05nT1OD2Fkh8SZMYfCHO9vEJSQdz4Squrh+LyDCK2IdF6QWJODzGcNfM/e5Z8WtEr46nLcXKF7cYSK3Wr3mR8TOMZKB55zTcjGBMmFOjhuceO1+KbxHLdaZ9eBF+Z/4Dqo+BkcJDbnwzmp9PECHCoz2n4Vz4IAAAAASUVORK5CYII="
}

Recipes now define their "type", eg:

{"type":"crafting_shaped","ingredients":[0],"inShape":[[0,null,0],[0,0,0]],"id":0,"result":{"id":1,"count":1}},{"type":"crafting_shapeless","ingredients":[0],"id":1,"result":{"id":2,"count":1}}

There is still a bit of work to do... Eg Tagged items such as "planks" (which can be any type of plank)... currently pulls just the first plank type. That's "ok", but I'd like to extend that definition a bit.

If there is anything in there that can help this project, feel free to "be inspired" by it 😉

@rom1504
Copy link
Member

rom1504 commented Nov 16, 2020 via email

@njt1982
Copy link
Contributor Author

njt1982 commented Nov 17, 2020

@rom1504 would be happy to help on that if I had the foggiest idea how to 😉

I've searched this repo for McData and it seems to be mentioned on the homepage as a link to a repo + several issues mention it. The McData repo says TODO: Add description and has no Wiki.

Without documentation for those unfamiliar with the guts of this project its an almost cliff-like learning curve. To be honest, this is the reason I stopped looking into this RE issue #290 in the first place... I saw this project used burger for recipes, I went to look at fixing up burger to produce recipes for smelting and was blocked on that by the project maintainer... There wasn't clear direction/steps for me to take to open a PR to help out.

I do genuinely want to help, so please dont take this critisism as any kind of attack... If you can point me in the right direction I'll happily take a look.

@TheDudeFromCI
Copy link
Member

@njt1982 I don't understand your question. This repo doesn't contain any code (some tools exist for the CI tests, but that's all), just JSON files inside the data folder. McData is just a compiled output of data that's managed to be scrapped together, regardless of the source. Some files had a lot of data extracted using external tools, some files were edited by hand. In the end, it doesn't matter how the files got edited, just what the JSON files contain.

@rom1504
Copy link
Member

rom1504 commented Nov 17, 2020

Indeed what I was suggesting was simply to put the file you already generated in minecraft data and that's it. The generator is your own code.
The only thing that would be good is using the same format as is currently used for crafting recipes.
For other kind of recipes a similar format would make sense (probably in another file)

The benefit of doing that is increasing the chance this data will stay maintained and updated for new versions, and more people can benefit from it.

I agree the extractors are not as well documented as they could be, they're not really organised yet in a single set of extractors. So for now we use anything that works, including the jar extractor code you wrote for example.

Does that make sense to you ?

@njt1982
Copy link
Contributor Author

njt1982 commented Nov 18, 2020

Ohhh!! I was under the impression there was some kind of automated/CI workflow for getting data consistently in via "known" scripts...

In that case I could probably knock something custom up to pull this data directly from a JAR using a NodeJS script...

The one I use at the moment modifies the structure slightly from this repo... I'll see if I can alter the script to keep it consistent. Did you want all the recipes in recipes.json or split out into "types"? (smelting, etc).

@rom1504 rom1504 merged commit b961b43 into PrismarineJS:master Jun 16, 2021
@njt1982 njt1982 deleted the revert-329-patch-1 branch June 17, 2021 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants