Liking cljdoc? Tell your friends :D

lambdaisland.witchcraft.fill

Fill algorithms, find areas of touching blocks based on a predicate.

Fill algorithms, find areas of touching blocks based on a predicate.
raw docstring

fillclj

(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`.
sourceraw docstring

fill-xclj

(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.
sourceraw docstring

fill-xyclj

(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.
sourceraw docstring

fill-xyzclj

(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.
sourceraw docstring

fill-xzclj

(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.
sourceraw docstring

fill-yclj

(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.
sourceraw docstring

fill-yzclj

(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.
sourceraw docstring

fill-zclj

(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.
sourceraw docstring

neighboursclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close