Skip to content

fix: replace per-block logging with summary and iterate by section skipping air in UnknownBlockCleaner#18

Open
Xytronix wants to merge 3 commits intoIroriPowered:masterfrom
Xytronix:fix-blockcleaner
Open

fix: replace per-block logging with summary and iterate by section skipping air in UnknownBlockCleaner#18
Xytronix wants to merge 3 commits intoIroriPowered:masterfrom
Xytronix:fix-blockcleaner

Conversation

@Xytronix
Copy link
Contributor

@Xytronix Xytronix commented Mar 3, 2026

Summary

I made UnknownBlockCleaner chunk cleanup less noisy and more efficient.

Instead of logging one warning per removed block, cleanup now aggregates removed unknown blocks by block ID and emits one summary log per chunk.

It also now prefers scanning only non-air sections by accessing BlockChunk/BlockSection.

This helps in the world ticking block after a player joins and turns this on in a modded world.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (requires documentation/migration)
  • Chore / refactor
  • Documentation only

Implementation details

  • Added section-based cleanup path:
    • Resolve BlockChunk via cached reflective lookup.
    • Iterate section Y ranges (ChunkUtil.SIZE stride).
    • Skip null/isSolidAir() sections.
  • Added fallback full scan when BlockChunk cannot be resolved.
  • Replaced per-block removal logging with aggregated Map<String, Integer> counters.

Checklist

  • Code compiles successfully
  • Pull request does not contain unrelated changes
  • Changes follow this project's code style (Use spotlessApply when necessary)
  • Changes are tested or will be tested after submission

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