You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
orstone
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
orstructure_void
.There are multiple ways to face this:
filter
parameter, taking in a BlockPalette, and another parameter for ignoring unwanted blocksClosure
orcallable
to allow the developer to write their own filtersThe text was updated successfully, but these errors were encountered: