Skip to content

Conversation

@PierreSchwang
Copy link
Member

Overview

Fixes a bug shared on discord.

Description

Use copypaste-brush (//br copypaste) with a falsy mask (e.g. //gmask 0) and select the area via the first click / interact. Output should state, that 0 blocks were copied.. Attempting to paste with that brush, results in no future actions being possible (potentially depending on the queue type).

That's due to the ResizableClipboardBuilder. As the mask did not match any blocks, no blocks were added to the builder. Therefor, on build the default dimensions are used, which results in the region spanning from XYZ Integer.MAX_VALUE to XYZ Integer.MIN_VALUE. The RegionVisitor - called by the ForwardExtentCopy - attempts to load all chunks in that range via the SingleThreadQueueExtent.

The fix is simply using an EmptyClipboard if nothing was being written into the ResizableClipboardBuilder.

### Submitter Checklist
- [x] Make sure you are opening from a topic branch (**/feature/fix/docs/ branch** (right side)) and not your main branch.
- [x] Ensure that the pull request title represents the desired changelog entry.
- [x] New public fields and methods are annotated with `@since TODO`.
- [x] I read and followed the [contribution guidelines](https://github.com/IntellectualSites/.github/blob/main/CONTRIBUTING.md).

@PierreSchwang PierreSchwang requested a review from a team as a code owner August 27, 2024 13:10
@github-actions github-actions bot added the Bugfix This PR fixes a bug label Aug 27, 2024
@SirYwell
Copy link
Member

I think I'd feel more comfortable with the check being in the ResizableClipboardBuilder#build() instead. It's currently not used anywhere else in FAWE, but that's also nothing we ever want to stumble upon again

@NotMyFault NotMyFault merged commit f5f9ae6 into main Aug 29, 2024
@NotMyFault NotMyFault deleted the fix/emptyCopyPasteBrush branch August 29, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix This PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants