fix(schematics): 🐛 prevent schematic truncation for plots exceeding world height#220
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Polygonal2DRegionfor clipboard operations, passing theBukkitWorldobject 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). DuringForwardExtentCopy, the actual block data failed to map to this squashed dimension, resulting in empty outputs.The Fix:
Replaced the
worldreference withnullduring the instantiation ofPolygonal2DRegioninsidePlotUtils.getOutlinesSchematicBytes()andPlotUtils.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.