Skip to content

Lionfish API

BonsUnleashed edited this page Oct 7, 2026 · 4 revisions

Lionfish API

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 Lionfish API (mod id lionfishapi; the library of L_Ender's Cataclysm): model boxes are drawn without new vectors per vertex (tested with 3.0), and the fluid-walk check reads its cells without throwaway arrays (tested with 2.8; 3.0 has the same check). 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
lionfishapi_fluid_walk_scan Lionfish API 2.8 (3.0 has the same check) BOTH 1.0.30 opt
lionfishapi_model_vertices LionfishAPI 2.8 (L_Ender's Cataclysm) CLIENT 1.0.28 opt

lionfishapi_model_vertices

Since: 1.0.28 · Target: LionfishAPI 2.8 (L_Ender's Cataclysm) · Side: CLIENT · Kind: opt

Mixin: LionfishBoxVerticesMixin

LionfishAPI model boxes without new vectors per vertex. LionfishAPI carries the same model-box loop as Citadel; the same two vectors now come from one reused vector on the render thread, as in citadel_model_vertices.

Measured: as citadel_model_vertices (the same proof covers both libraries).


lionfishapi_fluid_walk_scan

Since: 1.0.30 · Target: Lionfish API 2.8 (3.0 has the same check) · Side: BOTH · Kind: opt

Mixin: LionfishFluidWalkMixin

Lionfish API: the fluid-walk check reads its cells without throwaway arrays. Lionfish API (it comes with L_Ender's Cataclysm) checks, for every mob that moves without rising, whether it stands on a fluid it can walk over. Each check built 13 small arrays and 12 block positions, about 0.8 KB of garbage, and read 12 cells although only 6 are different. The check now reads the 6 cells once each, in the same order, with no garbage. A cell is skipped only where reading it again could not change anything (its chunk was read just before and nothing else ran in between); on a chunk's edge, or if the mob changes block during the check, it reads all 12 as before. Same fluid, same height, the same stand-on-fluid event, same result. (The profiler's "getChunk" counter, counted only while /debug or /perf runs, sees the 6 skipped repeat lookups less.)

Measured: offline on the transformed Entity, 1.5 million checks with identical results, events, mob state and chunk bookkeeping; dry ground 832 -> 0 bytes and about half the time per check (161-199 -> 79-122 ns over two runs), standing in water 11.3 -> 6.1 us. Before, the check was 0.45-0.6% of the server thread and 0.8% of its allocation in our pack.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally