Skip to content

Add command to automatically grow and shrink selection#3313

Open
Argmaster wants to merge 3 commits into
PixelGuys:masterfrom
Argmaster:selection-command
Open

Add command to automatically grow and shrink selection#3313
Argmaster wants to merge 3 commits into
PixelGuys:masterfrom
Argmaster:selection-command

Conversation

@Argmaster

@Argmaster Argmaster commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds selection command with following build-in sub commands:

  • /selection normalize
    Ensure 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.

shrink and grow were critical for bug fixing, so we should keep them around in case we want to do some future development.
adjust covers a very, very frequent pattern of grow+shrink, reducing amount of text needed at a cost of inefficiency.
cube is 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.
normalize is 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

@Argmaster Argmaster added enhancement a new feature or improvement and removed enhancement a new feature or improvement labels Jul 1, 2026
@Argmaster Argmaster moved this to Low Priority in PRs to review Jul 1, 2026
@Argmaster Argmaster marked this pull request as ready for review July 2, 2026 09:02
@Argmaster

Copy link
Copy Markdown
Collaborator Author

As a follow-up I would want to move /pos1 /pos2 and /deselect to be subcommands of /selection command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Low Priority

Development

Successfully merging this pull request may close these issues.

1 participant