-
-
Notifications
You must be signed in to change notification settings - Fork 0
Reference Exceptions and faults
The exception types falco-anvil throws, which ones cross the ChunkLoader boundary, and what a
caller can catch.
This page is a generation target, currently written by hand, and it is incomplete. Source of truth: the exception types in
net.onelitefeather.falco.anvil.RegionFormatException.Reasondeclares five constants andChunkDataException.Reasonsix; only the two named below are recorded in this wiki. Read the enums for the full set until the generator lands.
| Kind | sealed interface |
| Catchable | no — it is not a Throwable
|
| Carries | ChunkLocation |
| Source | AnvilFault |
The common contract of every Anvil failure, for a pattern switch after a broad catch.
| Kind | checked, abstract, sealed |
| Implements | AnvilFault |
| Source | AnvilFormatException |
Root of everything the file itself got wrong.
| Kind | checked, final |
| Extends | AnvilFormatException |
| Reasons | five constants on RegionFormatException.Reason
|
| Source | RegionFormatException |
Broken .mca structure: header shorter than 8192 bytes, implausible length field, overlapping
sectors, unsupported compression scheme.
| Kind | checked, final |
| Extends | AnvilFormatException |
| Reasons | six constants on ChunkDataException.Reason
|
| Source | ChunkDataException |
Broken chunk NBT: missing key, wrong type, empty palette, palette index out of range.
| Kind | unchecked, non-sealed |
| Implements | AnvilFault |
| Source | AnvilChunkException |
The boundary type. Unchecked so it can cross ChunkLoader, which declares no checked exceptions.
This is what loadChunk throws; the checked type above is its cause.
| Kind | record |
| Components | (chunkX, chunkZ, region, dimension) |
| Source | ChunkLocation |
The single definition of the log context. ChunkLocation.toString() is the one place the context
format is defined.
| Constant | On | Meaning |
|---|---|---|
UNSUPPORTED_CHUNK_VERSION |
ChunkDataException.Reason |
The chunk is below the version floor, or carries the pre-21w43a Level layout. |
MISSING_OR_MISTYPED_KEY |
ChunkDataException.Reason |
A key the caller requires is absent or holds the wrong tag type — including a chunk claiming Status: minecraft:full while carrying neither sections nor Level. |
| Method | Absent chunk | Unreadable chunk | Closed loader |
|---|---|---|---|
loadChunk |
returns null
|
throws AnvilChunkException
|
throws IllegalStateException
|
saveChunk |
— | logs at ERROR, counts, reports to the exception manager; does not throw |
throws IllegalStateException
|
saveChunks |
— | reports per group in awaitAll
|
throws IllegalStateException
|
loadChunk returns null only for three genuinely-absent cases: no region file, no location entry
for the chunk, and a chunk that is present but not fully generated.
BitPacker, SectorAllocator and PaletteData.singleValue throw IllegalArgumentException and
IllegalStateException for programmer errors. Real IO stays java.io.IOException — FileChannel,
Files and channel.force produce it and nothing wraps it.
Related: Explanation Why a second Anvil loader for why a read failure throws instead of
returning null · Reference Logging · How-to Load an Anvil world
Every published table lives on Reference Measured results, which owns them; a correction is made
there and nowhere else. What the ± after a JMH mean covers is defined once, in
Explanation What a measurement here means.
Wiki home · Repository · README and quick start · API documentation · Issues · Licence: AGPL-3.0
Getting started
How-to guides
- How-to Add Falco to your build
- How-to Load an Anvil world
- How-to Compute light for a loaded world
- How-to Keep chunk light up to date automatically
- How-to Use FalcoInstance instead of InstanceContainer
- How-to Migrate a world from an older version
four more
Reference
six more
Background
- Explanation Choosing between Falco and the built-in loader
- Explanation Scope and non-goals
- Explanation When light computation actually runs
- Explanation What a measurement here means
nine more
- Explanation Choosing between FalcoInstance and InstanceContainer
- Explanation How the Anvil loader is built
- Explanation How the light engine works
- Explanation How the concurrency design works
- Explanation How world migration works
- Explanation The chunk version guard
- Explanation Why a second Anvil loader
- Explanation Why a custom light engine
- Explanation Why falco-instance exists
- Explanation Comparing the light engine with Minestoms
- Explanation What the benchmarks establish
Project record
Working on Falco