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

Add a way to filter blocks #4

Open
inxomnyaa opened this issue Jun 16, 2022 · 0 comments
Open

Add a way to filter blocks #4

inxomnyaa opened this issue Jun 16, 2022 · 0 comments

Comments

@inxomnyaa
Copy link
Owner

inxomnyaa commented Jun 16, 2022

As of now, the blocks() iterator method takes in one parameter: layer (for i.e. waterlogged blocks)

It will always return all blocks in a layer, but one may desire to only get all planks or stone blocks, or even all liquids (still and flowing lava & water). There can also be the opposite case where you want to ignore specific blocks, i.e. air or structure_void.

There are multiple ways to face this:

  • Add an additional filter parameter, taking in a BlockPalette, and another parameter for ignoring unwanted blocks
  • A parameter taking in a string. This would allow for having wildcards for metadata. The strings might break due to block or property renames though.
  • A parameter taking in a Filter object. This is likely a flexible solution, whilst still easy to use.
  • A parameter taking in a Closure or callable to allow the developer to write their own filters
inxomnyaa added a commit that referenced this issue Aug 31, 2022
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