Skip to content

Fix blueprint copy sizes, sunken boats, and the blueprint schema - #3118

Merged
tastybento merged 3 commits into
developfrom
fix/blueprint-copy-size-entity-height
Nov 16, 2026
Merged

tastybento merged 3 commits into
developfrom
fix/blueprint-copy-size-entity-height

Conversation

@tastybento

@tastybento tastybento commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Two blueprint fixes found while testing #3117 on a 26.3 server. They were pushed to the #3117 branch after it had been merged, so they never reached develop.

Copy sizes were one short

xSize/ySize/zSize were set from the bounding box width. pos1/pos2 can be fractional (they come from where the player stands), so the width, and even width + 1, can undercount the blocks actually copied. A copy spanning 30 layers recorded ySize 29. Sizes are now counted the way getVectors copies: floor(max) - floor(min) + 1. The sizes are only used for the "no bedrock" centre fallback; the particle outline doesn't use them.

Entities pasted at the bottom of their block

Entities were stored by block with no height within that block, so a boat floating on water pasted sunk into the water block (a mob on a slab would paste inside the slab). configureEntity tried to apply an offset with e.getLocation().add(...), which only changes a copy and never did anything; that line is removed.

  • Ordinary entities now record their in-block height when copied and spawn at it via the new BlueprintEntity#getSpawnLocation(Location) (@since 3.23.8).
  • Horizontal position stays the block centre, as before.
  • Existing blueprints are unchanged: their entities have a height of 0 and paste exactly where they did.
  • Display and hanging entities (item frames, paintings) already place themselves and aren't affected.

JSON Schema (schemas/blueprint.schema.json)

  • Adds fill, fillMin, fillMax from Store blueprint air (or water) as a fill block instead of per block #3117. The Blueprint object has additionalProperties: false, so every compact blueprint failed validation.
  • Accepts {} for empty Vector-keyed maps. Gson writes an empty map as {}, not [], so any blueprint with no attached blocks or no entities failed. 23 of 35 real blueprints (game mode repos + test server) failed the old schema; all 35 pass now, and non-empty objects, unknown keys and malformed vectors are still rejected.
  • Documents entity y and inclusive sizes.

Testing

  • Unit tests: fractional-position copy gives inclusive sizes; a boat keeps its in-block height; an old-format entity and a display entity spawn at the paste location unchanged.
  • Full suite: 3651 tests, 0 failures.
  • On a 26.3 server with AcidIsland: a re-copied boat over the acid sea pastes floating (saved height 0.52); sizes match the copied box.

🤖 Generated with Claude Code

tastybento and others added 3 commits November 15, 2026 18:10
pos1/pos2 can be fractional (set from where the player stands), so the
box width plus one can still be one short. Count blocks the same way
getVectors does: floor(max) - floor(min) + 1. Found on a test server where
a copy spanning 30 layers recorded ySize 29.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entities were stored by block with no height within the block, and pasted
at the bottom of that block, so a boat floating on water pasted sunk into
it (and a mob on a slab pasted inside the slab). configureEntity tried to
apply the stored offset with e.getLocation().add(...), which only changes
a copy and never did anything.

Now ordinary entities store their height within the block when copied and
spawn at it via BlueprintEntity#getSpawnLocation. Horizontal position stays
the block centre, as before. Display and hanging entities already place
themselves and are unchanged. Entities in existing blueprints have a
height of 0 and paste exactly where they did before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add `fill`, `fillMin` and `fillMax` (new in 3.23.8, #3117). The Blueprint
  object has additionalProperties: false, so every compact blueprint
  failed validation.
- Gson writes an empty Vector-keyed map as `{}`, not `[]`. The schema only
  accepted arrays, so any blueprint with no attached blocks or no entities
  failed. 23 of the 35 blueprints in the game mode repos and on a test
  server failed the old schema; all 35 pass now. Non-empty objects are
  still rejected.
- Document entity `y` (height in the block, used since 3.23.8) and that
  sizes count both corner blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tastybento tastybento changed the title Fix blueprint copy sizes and sunken boats on paste Fix blueprint copy sizes, sunken boats, and the blueprint schema Nov 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit 857edc2 into develop Nov 16, 2026
3 checks passed
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