Add command to automatically grow and shrink selection#3313
Open
Argmaster wants to merge 3 commits into
Open
Conversation
Collaborator
Author
|
As a follow-up I would want to move |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds
selectioncommand with following build-in sub commands:/selection normalizeEnsure pos1 is set to minimal coordinates and pos2 is set to maximal coordinates from selection.
/selection cube <radius=5>Create a cube selection with center at current player position.
/selection shrink <limit=32>Automatically shrink the selection to fit a structure, non-air blocks stop shrinking process.
/selection grow <limit=32>Automatically grow the selection to fit a structure.
Non-air blocks stop growing process.
/selection adjust <limit=32>Same as grow followed by shrink.
shrinkandgrowwere critical for bug fixing, so we should keep them around in case we want to do some future development.adjustcovers a very, very frequent pattern of grow+shrink, reducing amount of text needed at a cost of inefficiency.cubeis a very convenient way to start selection wrapping process, instead of flying around and placing positions. Just fly up to the structure and make a large cube, then adjust - magic.normalizeis there for debug purposes. I'm also doing some normalization before shrinking or growing. It would be unrealistically complicated to ensure pos1 and pos2 retain their relative positions, so instead I guarantee they always become min and max.As for the code, it needs a priest to exorcise all the demons, a knight and to kill all the dragons and QuantumDeveloper to clean it up with my blood.
output.mp4