Skip to content

Improve //hollow command - #2960

Open
TomyLobo wants to merge 12 commits into
masterfrom
improve-hollow
Open

TomyLobo wants to merge 12 commits into
masterfrom
improve-hollow

Conversation

@TomyLobo

@TomyLobo TomyLobo commented Apr 26, 2026 •

Copy link
Copy Markdown
Collaborator
  • Add -p flag to iterate from placement position instead of the selection boundaries
  • Add -g flag to consider geometry in visibility calculations
  • Add -m <mask> flag to set the mask of blocks eligible for shell detection
  • By default, //hollow will no longer open up faces that are touching the selection bounding box.
    The old behaviour can be access with the -o flag.

Note: This is based on #2997, please don't squash.

@TomyLobo
TomyLobo changed the base branch from version/7.3.x to master April 26, 2026 15:24
@TomyLobo
TomyLobo force-pushed the improve-hollow branch 6 times, most recently from 7d72986 to 7c4af2d Compare May 1, 2026 14:25
@TomyLobo
TomyLobo marked this pull request as ready for review May 1, 2026 14:39
@TomyLobo
TomyLobo requested a review from a team as a code owner May 1, 2026 14:39
@TomyLobo
TomyLobo marked this pull request as draft May 5, 2026 21:59
@TomyLobo
TomyLobo force-pushed the improve-hollow branch 2 times, most recently from d4df329 to 89846a7 Compare May 10, 2026 11:30
@TomyLobo
TomyLobo marked this pull request as ready for review May 10, 2026 14:24
@TomyLobo
TomyLobo marked this pull request as draft June 21, 2026 09:26
@TomyLobo
TomyLobo marked this pull request as ready for review June 21, 2026 10:08
@TomyLobo
TomyLobo force-pushed the improve-hollow branch 2 times, most recently from aad6939 to bf5e4b3 Compare June 27, 2026 23:36
@TomyLobo
TomyLobo force-pushed the improve-hollow branch 7 times, most recently from fb84a38 to b44246e Compare August 18, 2026 23:55
Previously, the "Remove everything else in the selection" section had an
extra recursion step to get from the "outside" blocks to the "visible"
blocks.
Thickness 0 behaved like thickness 1
- Make a dedicated startingPositions Collection to initialize everything with
- Move declarations closer to their usage
- Add -p flag to iterate from placement position instead of the
  selection boundaries
- Add -g flag to consider geometry in visibility calculations
- By default, //hollow will no longer open up faces that are touching
  the selection bounding box. The old behaviour can be access with the
  -o flag.
Previously, the algorithm could enter a top slab through the top side
and leave through all other sides.
return affected;
}

private Direction[] getBlockedDirections(BlockVector3 position) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels almost too much to belong in EditSession, doesn't have to be moved but worth considering.

* @param thickness the thickness of the shell to leave (manhattan distance)
* @param pattern The block pattern to use
* Hollows out the region (bounding-box mode is semi-well-defined for non-cuboid selections).
* The startingPositions parameter takes precedence over usePlacementPosition.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is usePlacementPosition referring to here? There's no parameter or field in this class named that.

// The set of blocks that were seen
final Set<BlockVector3> visible = new HashSet<>(startingPositions);

// The set of blocks that were not only seen, but entered

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define what "entered" means?

case WEST -> net.minecraft.core.Direction.WEST;
case EAST -> net.minecraft.core.Direction.EAST;
case DOWN -> net.minecraft.core.Direction.DOWN;
default -> net.minecraft.core.Direction.UP;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can, it might be worth explicitly listing out the other values here to make it clear what we're mapping to UP

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants