Giter VIP home page Giter VIP logo

Comments (6)

rom1504 avatar rom1504 commented on July 3, 2024

Interesting data but it doesn't make the link between block/item id and block state, for example :

That means it's needed to extract that information from the wiki in a first step.

from minecraft-data.

rom1504 avatar rom1504 commented on July 3, 2024

Might be interesting :
flower_pot.json

{
    "variants": {
        "contents=empty":            { "model": "flower_pot" },
        "contents=rose":             { "model": "flower_pot_rose" },
        "contents=blue_orchid":      { "model": "flower_pot_orchid" },
        "contents=allium":           { "model": "flower_pot_allium" },
        "contents=houstonia":        { "model": "flower_pot_houstonia" },
        "contents=red_tulip":        { "model": "flower_pot_tulip_red" },
        "contents=orange_tulip":     { "model": "flower_pot_tulip_orange" },
        "contents=white_tulip":      { "model": "flower_pot_tulip_white" },
        "contents=pink_tulip":       { "model": "flower_pot_tulip_pink" },
        "contents=oxeye_daisy":      { "model": "flower_pot_daisy" },
        "contents=dandelion":        { "model": "flower_pot_dandelion" },
        "contents=oak_sapling":      { "model": "flower_pot_oak" },
        "contents=spruce_sapling":   { "model": "flower_pot_spruce" },
        "contents=birch_sapling":    { "model": "flower_pot_birch" },
        "contents=jungle_sapling":   { "model": "flower_pot_jungle" },
        "contents=acacia_sapling":   { "model": "flower_pot_acacia" },
        "contents=dark_oak_sapling": { "model": "flower_pot_dark_oak" },
        "contents=mushroom_red":     { "model": "flower_pot_mushroom_red" },
        "contents=mushroom_brown":   { "model": "flower_pot_mushroom_brown" },
        "contents=dead_bush":        { "model": "flower_pot_dead_bush" },
        "contents=fern":             { "model": "flower_pot_fern" },
        "contents=cactus":           { "model": "flower_pot_cactus" }
    }
}

from minecraft-data.

Yogu avatar Yogu commented on July 3, 2024

Any new ideas on this issue? I need a mapping from the 16-bit metadata to the model, i.e. the blockstate and its variant. Of course, this is not completely possible because not all block state is persisted in the metadata, it should be possible to get a close-enough mapping for many blocks.

Do you think we could use an automatic import from a data source? The wiki does not seem like the best source, it can be informal, e.g. for Fence Gate.

Thus I think these information need to be added manually, or does someone have a better idea?

Edit: I got an idea: Maybe we can just execute the getStateFromMeta methods of all block classes with 0..15 as parameter. They should not depend on the game status, so it should be pretty easy to execute them from a script.

A bit more info: Block.registerBlocks populates Block.BLOCK_STATE_IDS with a mapping of block IDs, textual ids (probably a canonical minecraft:... name, though there might be multiple for one ID as far as I understand) and Block instances. So we can just loop over this map to get all the Block instances with their ids, and then call getStateFromMeta to map block state ids (block id + meta combined, as stored in the world and sent over network) to Block-IBlockState combinations which in turn can be mapped to the blockstate entries in the JSON file via the BlockStateMapper.

from minecraft-data.

rom1504 avatar rom1504 commented on July 3, 2024

@Yogu I'm open to any way to extract that data, using the minecraft jar would definitely be a good way to do it.
If you feel like doing it please go ahead, I'll accept a PR with the resulting data, and would be interested by the extractor code !

from minecraft-data.

Yogu avatar Yogu commented on July 3, 2024

I made a small mod: forge-data-extractor that produces these files (whole list of files which is too large so the interesting file is not displayed).

What do you think would be helpful here? I think, the blockstate-ids.json would fit nicely in the variants part of blocks, and the blockstates-without-models could also be a good fit. However, we should first look into what these flags stand for, I just put in everything that was available.

from minecraft-data.

rom1504 avatar rom1504 commented on July 3, 2024

related https://github.com/PrismarineJS/minecraft-jar-extractor/blob/master/image_names.js and https://github.com/rom1504/minecraft-assets

@Yogu yes it could be useful, I'm not sure exactly where to put that in mcdata

from minecraft-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.