Skip to content
BonsUnleashed edited this page Oct 7, 2026 · 4 revisions

Relics

Minecraft 1.20.1 / Forge: this page documents that build and its measurements. For the separate 170-control Minecraft 1.21.1 port, see Minecraft 1.21.1 NeoForge.

Two controls for Relics 0.8.0.13 (mod id relics): the player capability answers other mods' capability queries without building a LazyOptional, and the fluid-walk check is skipped where none of its cells holds a fluid. Every switch checks the code it would change against the tested build; another build is left untouched with one WARN line (see How the patches are applied).

Key Target Side Since Kind
relics_fluid_walk_scan Relics 1.20.1-0.8.0.13 BOTH 1.0.30 opt
relics_foreign_capability_fast_path Relics 1.20.1-0.8.0.13 BOTH 1.0.26 opt

relics_foreign_capability_fast_path

Since: 1.0.26 · Target: Relics 1.20.1-0.8.0.13 · Side: BOTH · Kind: opt

Mixins: ForeignCapabilityFastPathMixin

Relics attaches a capability to every player, and Forge asks it about every capability any mod queries on a player (Tinkers' Construct does so for each HUD overlay every frame). For each such question it built a LazyOptional with its lock and listener set (128 bytes) that Forge then discarded, answering with the shared empty LazyOptional. A query for any other capability now gets that same empty LazyOptional at once; queries for Relics' own capability run unchanged.

Measured: offline on Relics' own class, every other capability returned the identical object, Relics' own capability behaved as before; 128 -> 0 bytes and 17 -> 2 ns per query. 1.5-2.9 MB/s of render-thread allocation before.


relics_fluid_walk_scan

Since: 1.0.30 · Target: Relics 1.20.1-0.8.0.13 · Side: BOTH · Kind: opt

Mixin: RelicsFluidWalkMixin

Relics: the fluid-walk check is skipped where none of its cells holds a fluid. Relics checks, for every mob that moves without rising, whether it stands on a fluid it can walk over (for the Aqua and Magma Walker relics). Each check built 13 small arrays and 12 block positions, about 0.75 KB of garbage, even with no fluid anywhere near, which is most of the time. A small check now reads the same 12 cells first, in the same order, without garbage: when none of them holds a fluid, Relics' answer is already known (the movement stays as it is, no event) and its check is skipped. Near a fluid, or when the cells reach into the next chunk, Relics' own check runs as before. None of Relics' code is copied. (Near a fluid the cells are read twice, so the profiler's "getChunk" counter, counted only while /debug or /perf runs, shows 12 more lookups there.)

Measured: offline on the transformed Entity, 1.5 million checks with identical results, events, mob state and chunk bookkeeping; dry ground 111 -> 67 ns and 736 -> 0 bytes per check, unchanged near fluids and on chunk edges. Before, the check was 1.9% of the server thread's allocation in our pack.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally