-
-
Notifications
You must be signed in to change notification settings - Fork 0
Reference Replaceable policies
The three services FalcoAnvilLoader consults, their interfaces, their shipped defaults, and how
each is supplied.
This page is a generation target, currently written by hand. Source of truth: the policy interfaces and their
META-INF/servicesregistrations infalco-anvil.
| Method | void check(CompoundBinaryTag data, int minimumDataVersion) throws ChunkDataException |
| Shipped default | DefaultChunkVersionPolicy |
| Registered by |
falco-anvil, in its own META-INF/services
|
| Builder slots |
versionPolicy(ChunkVersionPolicy), discoverVersionPolicy()
|
| Can be disabled | yes — versionPolicy(null)
|
| Consulted | once per load, after the raw compound is parsed, before anything is decoded |
| Source | ChunkVersionPolicy |
Decides whether a chunk is readable at all. A policy only decides and throws; it does not count or
log — FalcoAnvilLoader#checkVersion does both regardless of which policy ran.
| Methods |
String onUnknownBlock(String name, @Nullable CompoundBinaryTag properties), String onUnknownBiome(String name)
|
| Returns | a replacement name, not an id |
| Shipped default |
DefaultUnknownEntryPolicy — "minecraft:air" and "minecraft:plains"
|
| Registered by |
falco-anvil, in its own META-INF/services
|
| Builder slots |
unknownEntryPolicy(UnknownEntryPolicy), discoverUnknownEntryPolicy()
|
| Can be disabled | no — unknownEntryPolicy(null) falls back to the default |
| Consulted | by BlockPaletteResolver#toId and BiomePaletteResolver#toId
|
| Source | UnknownEntryPolicy |
Decides what an unknown palette entry becomes. Throwing AnvilChunkException from either method
fails the chunk instead of carrying a substitute. The policy is not asked twice: if the name it
returns is itself unknown, the resolver throws IllegalStateException. The resolvers report the
name to AnvilDiagnostics and the log regardless of what the policy returns.
| Shipped default | none in falco-anvil — the engine lives in falco-migration
|
| Builder slot | selecting a ChunkMigrationMode
|
| Discovery | turned on by selecting a mode; no second call needed |
| Consulted | only when a mode is selected |
| Missing provider | the loader fails to build rather than migrating nothing |
| Source | ChunkMigrator |
Translates a chunk an older version wrote, rather than deciding what to do about it. Runs before
ChunkVersionPolicy. See Reference Migration modes.
Implemented in
ServiceResolution
and shared by all three.
| Rule | Behaviour |
|---|---|
| Shipped default vs one foreign provider | the shipped default steps aside |
| Two foreign providers | throws, naming both classes |
| Builder slot and discovery both set | throws IllegalStateException
|
Any call to versionPolicy(...) / unknownEntryPolicy(...)
|
turns discovery off for that policy, including when passed null
|
| Classloader used for discovery | the service's own, never the thread context classloader |
| When resolution runs | once, when the loader is built — not per chunk |
The opening log line of the loader reports which version policy was resolved, or the word none.
Related: How-to Replace the version and unknown-entry policies · Explanation The chunk version guard
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