csharpfritz / csharpfritz/Aspire-Minecraft
[MCA Inspector] Implement AnvilRegionReader
- Dominant language
- C#
- Stars
- 31
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Implement the core AnvilRegionReader class that reads Minecraft Anvil (.mca) region files and queries block state at world coordinates.
## Tasks
- [ ] Parse region file paths (r...mca format)
- [ ] Implement GetBlockAt(x, y, z) using NBT library
- Convert world coordinates to region/chunk/section/block offsets
- Handle Y range -64 to 319 (1.20+ format)
- Return block state object with type + properties
- [ ] Handle edge cases: out-of-bounds, unloaded chunks, missing files
- [ ] Add XML documentation
- [ ] Logging for debugging
## Unit Tests
- [ ] Read block at corners, center, different Y levels
- [ ] Handle out-of-bounds coordinates
- [ ] Handle missing files gracefully
## Acceptance Criteria
- [ ] Single test verifies known block at specific coordinate in test .mca file
- [ ] No uncaught exceptions on invalid input
- [ ] Performance: <100ms to load region + query 100 blocks
- [ ] Code coverage >90%
Contributor guide
Assessment
This issue has not been assessed yet.