Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added hollow and outline commands and brushes, to keep chipping away at tasks in #28.
The commands affect all blocks within a selection, hollowing out or outlining (adding at the border of) blobs of blocks of the same type. There's an optional block argument in both commands to specify what types of blocks to affect. The brushes work a bit differently, since instead of affecting all blocks within the selection, they search for a blob of blocks connected to the block clicked with the brush (blob of blocks meaning all connected blocks of the same type as the starting one) and apply hollow or outline only to those blocks. Outline replaces only air (or greenery, if used with
-g
).The name
outline
collides with the one added in #45 (and as of now waiting to be readded in #52). I suggest renaming that one tooutline_selection
and leaving this new command as planeoutline
. If that is the case, the renaming should be done when merging that PR.Implementing these two features brings to light an issue that is to be solved in the future by someone that wants to, not in this PR: flood, hollow, outline and drain all take into account only neighburs in cartesian directions (that is, the 6 direct neighbors of a block, not counting the diagonal ones). This is fine for most cases, but it produces counter intuitive results in some cases. Particularly in cases where an outline brush is meant to be applied multiple times to give a thicker outline: the second application doesn't work properly, since the outline placed by the app is not considered as a "block of blocks" (they connect only diagonally in some cases). I think the best solution for this will be adding a new flag that affects all functions that check neighbors. I'll open an issue later.