Skip to content

fix(schematics): 🐛 prevent schematic truncation for plots exceeding world height#220

Merged
Zoriot merged 2 commits into
mainfrom
fix-focus-plots
May 23, 2026
Merged

fix(schematics): 🐛 prevent schematic truncation for plots exceeding world height#220
Zoriot merged 2 commits into
mainfrom
fix-focus-plots

Conversation

@Zoriot
Copy link
Copy Markdown
Member

@Zoriot Zoriot commented May 22, 2026

The Issue:
Plots originating from coordinates above standard world height limits (e.g., Y=351 to Y=606 for Plot 944) were failing to generate correctly. This resulted in completely void schematics when loading outlines or saving completed plots.

The Cause:
When defining the Polygonal2DRegion for clipboard operations, passing the BukkitWorld object forced WorldEdit to aggressively clamp the region's Y-bounds to the world's max build height (typically Y=320). This caused high-altitude regions to collapse into a flattened 1-block height mapping (minY: 320, maxY: 320). During ForwardExtentCopy, the actual block data failed to map to this squashed dimension, resulting in empty outputs.

The Fix:
Replaced the world reference with null during the instantiation of Polygonal2DRegion inside PlotUtils.getOutlinesSchematicBytes() and PlotUtils.savePlotAsSchematic(). Omitting the world constraint forces WorldEdit to fallback to its global absolute limits (±30,000,000) instead of the local world bounds, fully preserving the plot's native schematic dimensions.

@Zoriot Zoriot requested a review from Cinnazeyy May 22, 2026 15:01
@Zoriot Zoriot self-assigned this May 22, 2026
@Zoriot Zoriot added bug Something isn't working high priority labels May 22, 2026
…orld height

**The Issue:**
Plots originating from coordinates above standard world height limits
(e.g., Y=351 to Y=606 for Plot 944) were failing to generate correctly.
This resulted in completely void schematics when loading outlines or
saving completed plots.

**The Cause:**
When defining the `Polygonal2DRegion` for clipboard operations, passing
the `BukkitWorld` object forced WorldEdit to aggressively clamp the region's
Y-bounds to the world's max build height (typically Y=320). This caused
high-altitude regions to collapse into a flattened 1-block height mapping
(minY: 320, maxY: 320). During `ForwardExtentCopy`, the actual block data
failed to map to this squashed dimension, resulting in empty outputs.

**The Fix:**
Replaced the `world` reference with `null` during the instantiation of
`Polygonal2DRegion` inside `PlotUtils.getOutlinesSchematicBytes()` and
`PlotUtils.savePlotAsSchematic()`. Omitting the world constraint forces
WorldEdit to fallback to its global absolute limits (±30,000,000) instead
of the local world bounds, fully preserving the plot's native schematic
dimensions.
@Zoriot Zoriot force-pushed the fix-focus-plots branch from 5214b40 to 9fc208e Compare May 22, 2026 15:01
Copy link
Copy Markdown
Member

@Cinnazeyy Cinnazeyy left a comment

Choose a reason for hiding this comment

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

LGTM!

@Zoriot Zoriot closed this May 23, 2026
@Zoriot Zoriot reopened this May 23, 2026
@Zoriot Zoriot merged commit 1a6c222 into main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants