Skip to content

L2 Library

BonsUnleashed edited this page Oct 7, 2026 · 3 revisions

L2 Library

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 L2 Library (mod id l2library; tested with the 2.5.1 builds that ship inside Ars Delight 1.2.2): the effect-icon pass returns at once for entities without client effects, and a fix keeps the other players' effect icons when one player stops seeing a mob. 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
l2library_effect_icon_fast_path L2 Library 2.5.1-slim (inside Ars Delight 1.2.2) CLIENT 1.0.30 opt
l2library_stop_tracking_noop L2 Library 2.5.1 (inside Ars Delight 1.2.2) BOTH 1.0.30 fix

l2library_effect_icon_fast_path

Since: 1.0.30 · Target: L2 Library 2.5.1-slim (inside Ars Delight 1.2.2) · Side: CLIENT · Kind: opt

Mixin: EffectIconFastPathMixin

L2 Library: the effect-icon pass returns at once for entities without client effects. After every living entity is drawn, every frame (GeckoLib entities included), L2 Library looked the entity's client effect capability up, checked its "ClientOnly" tag, looked the same capability up a second time and went through its effect map, and only then found that there was nothing to draw. The map only fills when the server sends a tracked effect, which this pack never does. Now the first lookup also checks the map, and when it is empty the pass ends there: nothing was going to be drawn in that case, so the result is the same. An entity with effects goes through L2's code as before. The one difference inside the game is that the second, identical capability lookup is not made for such an entity; capability lookups only read (all 443 in this pack were checked), so nothing can notice. -Dbons_and_furious.l2libraryEffectIconFastPath.shadow=true lets L2's code run every time and checks that the second lookup gives the same capability with an empty map (for testing).

Measured: offline on L2's own classes and Forge's capability dispatcher, 6,000 entity states with and without the capability, effects, client render effects and the ClientOnly tag: the same icons, outcome and provider calls, except the skipped second lookup; 24.5 -> 16.3 ns per drawn entity with no other capabilities, 74 -> 50 ns to 102 -> 45 ns with eight other capabilities attached, 0 bytes either way (median of 9 rounds).


l2library_stop_tracking_noop

Since: 1.0.30 · Target: L2 Library 2.5.1 (inside Ars Delight 1.2.2) · Side: BOTH · Kind: fix

Mixin: StopTrackingNoopMixin

L2 Library: when one player stops seeing a mob, the other players no longer lose its effect icons. L2 Library shows some mob effects to nearby players. When a player stopped tracking a mob, it sent "this effect ended" for each such effect to the mob's viewers, but Forge has already taken the leaving player off that list by then, so the message only reached the players who still see the mob, and their game wrongly dropped the effect. The message is no longer sent: the leaving player never received it anyway, the others keep the correct state, and a player who comes back into range still gets the effects. In this pack no mod marks effects for L2 Library to show, so nothing changes here; it matters for packs with L2 content mods.

Measured: offline on L2 Library's own class: with a shown effect the original goes on to send the message and the fixed handler returns; without one both do nothing; Forge's order (player removed, then the event) is pinned by the switch's fingerprints.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally