csharpfritz / csharpfritz/Aspire-Minecraft

[MCA Inspector] Implement AnvilRegionReader

Open
#93 0 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.