promotional bannermobile promotional banner

Enchanted Outlines

Each enchantment type is assigned a unique color identifier, allowing you to instantly comprehend the power of the item in your hand
Back to Files

enchanted_outlines-0.1.3.jar

File nameenchanted_outlines-0.1.3.jar
Uploader
LOVE_U987LOVE_U987
Uploaded
Aug 8, 2026
Downloads
21
Size
71.3 KB
Mod Loaders
NeoForge
File ID
8601074
Type
R
Release
Supported game versions
  • 1.21.1

Curse Maven Snippet

NeoForge

implementation "curse.maven:enchanted-outlines-1643642:8601074"

Learn more about Curse Maven

What's new

✨ Enchanted Outlines Changelog


🚀 v0.1.3 (2026-08-08)

🐛 Bug Fixes

  • Fixed armor/elytra outlines turning into solid blocks under shaders

    • The game's native PNG reader couldn't handle palette-based transparency (tRNS) used by vanilla armor textures, making every pixel fully opaque. Outlines became solid cubes instead of following the item shape.
    • Switched to ImageIO for proper alpha decoding — armor outlines now respect actual transparency.
  • Fixed wildly broken outline colors from unnormalized brightness

    • Brightness values were accidentally multiplied by 255 instead of staying in the 0–1 range, causing color values to explode (scale ~55–113 instead of ~0.35–1.0). RGB channels overflowed and produced garbled neon messes.
    • Now properly normalized — colors behave predictably again.
  • Fixed outlines collapsing into solid rectangles when color blending is off

    • When "blend outline with item color" was disabled, certain textures (especially modded armor without full RGBA format) threw exceptions during shape generation. The renderer either gave up or fell back to a plain white square.
    • Shape generation is now fully exception-safe: if brightness can't be read, it simply skips the darkening step instead of breaking the outline.
  • Fixed config screen changes not applying until restart

    • Saving settings from the in-game config menu wrote to disk but forgot to refresh the internal color/setting cache. Your changes were ignored until you restarted or pressed F3+T.
    • Cache now invalidates immediately on save — changes apply right away.

⚡ Performance Improvements

  • Cached model geometry — no more recalculating every frame

    • Before: every rendered item slot re-traversed the entire model, rebuilt vertex normals, and allocated fresh HashMaps — 64 inventory slots meant 64 full rebuilds per frame.
    • After: geometry is computed once per unique item model and reused across slots and frames. Significantly less CPU work and zero per-frame garbage from normal calculations.
  • Eliminated redundant work on the render hot path

    • Cached shader uniform references instead of looking them up by name twice per slot per frame.
    • Reused precomputed quad normals across all 8 outline directions instead of recalculating per direction.
    • Pulled direction-independent matrix transforms out of the direction loop — 8 directions now share the base transform, only applying a single cheap translation per direction.
    • Cached sprite-to-quad index mapping to remove per-frame indexOf scans.
    • Reused temporary Matrix4f objects when rendering armor cube shells instead of allocating 3 new ones per cube.
  • Cut reflection overhead

    • Shader compatibility checks (needVanillaShaderFallback) were doing slow reflection calls every frame. Now cached with a 500ms refresh — shader pack switches take at most half a second to reflect.
    • spriteOriginalImage field lookup is now statically cached and walks the class hierarchy, so modded sprite subclasses work without repeated reflection.
    • Average brightness is cached per texture location — no more re-scanning the same image pixels for different outline colors.
  • Removed 289,000+ lines of spam debug logging per session

    • HumanoidArmorLayerMixin was printing "Armor outline rendered" on every frame for every armor slot — 289,687 times in one test run alone.
    • Cleaned up all per-frame debug logs. Log output dropped from 289,921 lines to 212 lines. Less disk I/O, cleaner logs, same working outlines.

🎨 Visual Polish

  • Added exposure reduction for solid-color outlines
    • When color blending is off, bright outlines (pink, gold, white) were painfully overexposed under emissive lighting or shaders — there was no item color to naturally tone them down.
    • Outlines now auto-darken based on the item's average perceived brightness (Rec.601 weighted luminance × alpha). Dark items like iron swords get noticeably dimmer outlines; bright items like golden apples stay vivid.
    • Formula: finalBrightness = 0.35 + 0.65 × itemLuma
    • New config option: outlineExposureReduce (default: ON) — toggle in the General section of the config screen.

📝 Developer / Agent Safety

  • Added 19 inline guardrail comments to OutlineRenderer.java
    • Key lessons from past rendering regressions are now embedded directly at the code sites where mistakes happened:
      • Use ImageIO, never NativeImage.read for palette+tRNS textures.
      • Brightness must stay 0–1 normalized; overflow destroys colors.
      • The three outline algorithms (flat shape texture, 3D geometry expansion, armor per-cube shell) must not be split or mixed inconsistently.
      • Geometry cache must only store frame-independent inputs.
      • NativeImage pixel format is ABGR — mind the byte order.
    • These are comment-only changes; zero logic was altered.

📦 Full File Impact

File Changes
OutlineRenderer.java Bug fixes, performance caching, exposure darkening, guardrail comments
EnchantedConfigScreen.java Cache invalidation on save, new exposure toggle UI
Config.java New outlineExposureReduce config field
EnchantedOutlinesClient.java Removed temporary debug hooks
ItemRendererMixin.java Cleaned up diagnostic code
HumanoidArmorLayerMixin.java Removed per-frame debug spam
ThrownTridentRendererMixin.java Removed debug logging, made cache instance-local
zh_cn.json / en_us.json Localization for new config option
AGENTS.md New project rules documenting rendering architecture lessons

This mod has no additional files