Skip to content

Honor Ore.blob() vein size in nether/end ore generation#106

Merged
tastybento merged 3 commits into
developfrom
fix/ore-blob-size
Jun 27, 2026
Merged

Honor Ore.blob() vein size in nether/end ore generation#106
tastybento merged 3 commits into
developfrom
fix/ore-blob-size

Conversation

@tastybento

Copy link
Copy Markdown
Member

Fixes issue #1 from the #105 review.

Problem

NewMaterialPopulator never read the blob (vein size) field of Ore: BLOB_SIZE was hardcoded to 1, and the x/z loops shared a single offset. Every nether/end ore vein collapsed to a 1–4 block speck along the chunk diagonal regardless of its configured size (values up to 33), and Ore.blob() was dead.

Fix

pasteBlob now scatters o.blob() blocks around an independently-chosen (centreX, centreZ, y) centre, over a radius derived from cbrt(blobSize) so a vein of N blocks occupies a roughly N-block volume. It is bounded by the configured world depth and a max-attempts guard so sparse regions cannot loop forever. The unused BLOB_SIZE constant is removed.

🤖 Generated with Claude Code

tastybento and others added 3 commits June 26, 2026 16:46
The blob size carried by each Ore was never read: BLOB_SIZE was hardcoded to 1
and the x/z loops shared a single offset, so every nether/end ore vein
collapsed to a 1-4 block speck regardless of its configured size.

pasteBlob now scatters o.blob() blocks around an independently-chosen centre,
over a radius derived from the cube root of the vein size, bounded by the
configured world depth and a max-attempts guard. The unused BLOB_SIZE constant
is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the three guard 'continue' statements with combined boolean conditions
so the loop has no break/continue, resolving the SonarCloud code smell on
new_maintainability_rating.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@tastybento tastybento merged commit 5981718 into develop Jun 27, 2026
3 checks passed
@tastybento tastybento deleted the fix/ore-blob-size branch June 27, 2026 22:50
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