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

feat: Setting properties on a BlockState generically #140

Open
Sculas opened this issue Apr 15, 2024 · 0 comments
Open

feat: Setting properties on a BlockState generically #140

Sculas opened this issue Apr 15, 2024 · 0 comments

Comments

@Sculas
Copy link
Contributor

Sculas commented Apr 15, 2024

Currently, you need the concrete type of a block to set, for example, the facing.
However, this isn't possible in cases where you don't know the concrete type of a block.
Properties don't have FromStr implemented either, so you can't go from a waterlogged=true to Waterlogged(true).

All in all, this makes it very hard (almost impossible I'd say) to implement a WorldEdit schematic parser, because you can't parse a value like this one: minecraft:birch_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] to it's corresponding BlockState.

My current workaround is to use a LUT, taken from here.

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

No branches or pull requests

1 participant