Skip to content

Paste and copy blueprints within a per-tick time budget - #3119

Merged
tastybento merged 2 commits into
developfrom
perf/blueprint-time-budget
Nov 16, 2026
Merged

tastybento merged 2 commits into
developfrom
perf/blueprint-time-budget

Conversation

@tastybento

@tastybento tastybento commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Pasting and copying blueprints ran exactly one batch of paste-speed (64) blocks per tick: about 1,280 blocks a second, however idle the server is. The AcidIsland starter island is 6,562 blocks, about 5 s for the Overworld alone, and the player isn't teleported until the Overworld, Nether and End have all pasted one after another.

Time budget

  • New setting island.paste-time-budget (milliseconds per tick, default 10, since 3.23.8). Each tick, pasting runs batches of paste-speed until the budget is used up, the paste is finished, or a batch is waiting for a chunk to load (currentTask not done). Copying runs batches until the budget is used or the copy is done.
  • 0 keeps the old behaviour: one batch per tick.
  • Changes are internal to BlueprintPaster and BlueprintClipboard; PasteHandler and DefaultPasteUtil are unchanged, so BentoBoxFAWEHandler is unaffected.

Copy fixes

  • Entities found once: world.getNearbyEntities over the copy box at the start, instead of scanning every entity in the world on every tick.
  • No more quadratic slowdown: the block list is stepped through by index. stream().skip(index) walked past every block already copied, every tick, so copy time grew with the square of the copy size.
  • ItemsAdder hook looked up once, not per block.
  • Progress messages report the highest 10% mark passed each tick; batches can now jump past exact multiples of 10.

Notes

  • The "estimated time" message shown to players when an island is created is only sent when paste-time-budget is 0. With a budget, the paste time depends on the server's spare time and usually finishes almost at once, so the old estimate overstated it. The block count message is still sent.
  • Tested on a 26.3 server with AcidIsland at the default budget (10 ms): a new island pasted almost instantly (previously about 5 s for the Overworld alone), and a large copy air finished quickly.

Tests

  • Paster: budget 0 pastes one batch per tick; a large budget pastes 200 blocks in one tick (4 batches) and finishes; pasting stops when a batch waits for a chunk.
  • Copy: a large budget finishes a 27-block copy in one tick at paste-speed 4; budget 0 takes 7 ticks, scans entities once, and reports progress at 10, 20, 40, 50, 70, 80, 100%.
  • Existing state-machine tests run with budget 0.
  • Full suite: 3657 tests, 0 failures.

🤖 Generated with Claude Code

tastybento and others added 2 commits November 15, 2026 19:20
Pasting and copying ran exactly one batch of paste-speed (64) blocks per
tick, about 1,280 blocks a second no matter how idle the server was. The
AcidIsland starter island (6,562 blocks) took about 5 s for the
Overworld alone, and the player waits for every world before teleport.

- New setting island.paste-time-budget (ms per tick, default 10). Pasting
  and copying run batches of paste-speed until the budget is used, the
  work is done, or (pasting) a batch is waiting for a chunk to load.
  0 keeps the old one-batch-per-tick behavior.
- Copy: find entities once with getNearbyEntities over the copy box,
  instead of scanning every entity in the world each tick; step through
  the block list by index instead of stream().skip(index), which made
  copy time grow with the square of its size; look up the ItemsAdder
  hook once. Progress messages now report the highest 10% mark passed
  each tick (batches can jump past exact multiples).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With a time budget, pasting is limited by the server's spare time and
usually finishes almost at once, so the one-batch-per-tick estimate
overstated it by seconds. The block count message is still shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit 1da0801 into develop Nov 16, 2026
3 checks passed
@tastybento
tastybento deleted the perf/blueprint-time-budget branch November 16, 2026 05:08
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.

1 participant