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

Support structure block keys with a list of items #7

Open
solonovamax opened this issue Jun 12, 2024 · 1 comment · May be fixed by #9
Open

Support structure block keys with a list of items #7

solonovamax opened this issue Jun 12, 2024 · 1 comment · May be fixed by #9

Comments

@solonovamax
Copy link

Support using structure block keys which contain a list of items

For example:

{
    "keys":   {
        "S":      "minecraft:sea_lantern",
        "p":      [
            "minecraft:prismarine",
            "minecraft:prismarine_bricks",
            "minecraft:dark_prismarine"
        ],
        "d":      [
            "minecraft:dark_prismarine",
            "minecraft:prismarine",
            "minecraft:prismarine_bricks"
        ],
        "anchor": "minecraft:conduit"
    },
    ...
}

Each key is either a string or an array of strings, both of which are parsed by BlockArgumentParser.blockOrTag().

I'm probably going to PR a change later that does this. (it's a not-too invasive change in StructureTemplate.parse, as well as a few additional utility classes just to make the code cleaner and avoid the anonymous classes.)

@solonovamax
Copy link
Author

solonovamax commented Jun 12, 2024

An alternative syntax could be:

{
    "keys":   {
        "S":      "minecraft:sea_lantern",
        "p":      "minecraft:prismarine,minecraft:prismarine_bricks,minecraft:dark_prismarine",
        "d":      "minecraft:dark_prismarine,minecraft:prismarine,minecraft:prismarine_bricks",
        "anchor": "minecraft:conduit"
    },
    ...
}

and then splitting it on ,. Though, care would need to be taken to not split it on commas in the nbt data.

This one is more similar to patchouli's syntax.

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 a pull request may close this issue.

1 participant