Skip to content

Entity Texture Features

BonsUnleashed edited this page Oct 7, 2026 · 3 revisions

Entity Texture Features

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.

One control for Entity Texture Features 7.1 (mod id entity_texture_features, LGPL-3.0), client-side: each sprite's texture id is worked out once. The switch replaces one of ETF's own hooks with an equal one that remembers the id; another ETF build keeps its own hook. The 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
etf_sprite_texture_id_memo Entity Texture Features 7.1 CLIENT 1.0.21 opt

etf_sprite_texture_id_memo

Since: 1.0.21 · Mixins: SpriteTextureVariantMixin, SpriteCoordinateExpanderAccessor · Helper: bons.furious.patch.etf.SpriteTextureIds Patched: net.minecraft.client.resources.model.Material.buffer, where ETF's MixinSpriteIdentifier injects

What upstream did. ETF hooks Material.buffer, which chests, signs, beds, banners, shields, bells and decorated pots use every frame, to swap in texture variants. On every call the hook derived the sprite's texture id from the sprite name: a string build and a newly validated ResourceLocation.

What the patch does. While the switch applies, MixinSquared cancels ETF's MixinSpriteIdentifier and an identical handler (ETF's code statement for statement, LGPL-3.0, notice retained) takes its place at the same injection point, with the texture id taken from a memo keyed by the sprite name. A name that already ends in .png is still returned as itself; an id that fails validation is never remembered, so it fails the same way every time. The variant lookup and render-type swap that follow are ETF's own code, unchanged. On another ETF build the switch is skipped and ETF's own mixin stays in place.

What stays the same. The ids (equal, same hash, same string) and everything ETF does with them. In the 1.0.21 client run the memo was checked against ETF's own derivation for all 54,657 sprites of the chest, sign, banner, shield, bed, pot, shulker and block atlases, and Material carried only the replacement handler.

Measured. 134 → 7 ns per call on the real classes (−95 %). The hook was 0.43 % of the render thread in a storage-heavy client profile, 0.27 % of it constructing ids.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally