Fill algorithms, find areas of touching blocks based on a predicate.
Fill algorithms, find areas of touching blocks based on a predicate.
(fill start)(fill start {:keys [limit throw?] :or {limit 15 throw? true} :as opts})Recursively find neighbours, as per neighbours.
It's quite easy to accidentally trigger an infinite loop, which will crash
your Minecraft server. To somewhat guard against that the result set will only
grow for :limit iterations. If the algorithm hasn't terminated yet at that
point an exception will be thrown. Increase :limit or set it to false if
you really know what you're doing. Defaults to 15.
Recursively find neighbours, as per [[neighbours]]. It's quite easy to accidentally trigger an infinite loop, which will crash your Minecraft server. To somewhat guard against that the result set will only grow for `:limit` iterations. If the algorithm hasn't terminated yet at that point an exception will be thrown. Increase `:limit` or set it to `false` if you really know what you're doing. Defaults to `15`.
(fill-x start)(fill-x start opts)Perform a fill along the x axis. Convenience function.
Perform a [[fill]] along the x axis. Convenience function.
(fill-xy start)(fill-xy start opts)Perform a fill along the x, and y axes. Convenience function.
Perform a [[fill]] along the x, and y axes. Convenience function.
(fill-xyz start)(fill-xyz start opts)Perform a fill along the x, y, and z axes. Convenience function.
Perform a [[fill]] along the x, y, and z axes. Convenience function.
(fill-xz start)(fill-xz start opts)Perform a fill along the x, and z axes. Convenience function.
Perform a [[fill]] along the x, and z axes. Convenience function.
(fill-y start)(fill-y start opts)Perform a fill along the y axis. Convenience function.
Perform a [[fill]] along the y axis. Convenience function.
(fill-yz start)(fill-yz start opts)Perform a fill along the y, and z axes. Convenience function.
Perform a [[fill]] along the y, and z axes. Convenience function.
(fill-z start)(fill-z start opts)Perform a fill along the z axis. Convenience function.
Perform a [[fill]] along the z axis. Convenience function.
(neighbours loc)(neighbours loc
{:keys [dx dy dz pred materials]
:or {dx [-1 0 1] dy [0] dz [-1 0 1]}})Find all neighbours of a single block along the given axes, defaults to :x/:z, i.e. neighbours in a horizontal plane.
:dx / :dy / :dz each determine how a given axis is traversed, e.g.
:dx [-1 0 1] will traverse both towards positive and negative X (east/west),
whereas :dx [0 1] will only traverse towards positive X. :dy [0] (the
default for Y) means the Y value will not change, i.e. only the current Y
level (height) is considered.
:pred is a function which receives a block, and returns true if the block
should be added to the result, or false otherwise. The default function
considers all blocks that are not :air blocks.
Alternative pass in a set of :materials (keywords), and it will only find
neighbours of those types.
Find all neighbours of a single block along the given axes, defaults to :x/:z, i.e. neighbours in a horizontal plane. `:dx` / `:dy` / `:dz` each determine how a given axis is traversed, e.g. `:dx [-1 0 1]` will traverse both towards positive and negative X (east/west), whereas `:dx [0 1]` will only traverse towards positive X. `:dy [0]` (the default for Y) means the Y value will not change, i.e. only the current Y level (height) is considered. `:pred` is a function which receives a block, and returns true if the block should be added to the result, or false otherwise. The default function considers all blocks that are not `:air` blocks. Alternative pass in a set of `:materials` (keywords), and it will only find neighbours of those types.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |