Skip to content

Add a night vision curve - #3

Open
FrCynda wants to merge 3 commits into
MarioS271:mainfrom
FrCynda:nv-curve
Open

FrCynda wants to merge 3 commits into
MarioS271:mainfrom
FrCynda:nv-curve

Conversation

@FrCynda

@FrCynda FrCynda commented Aug 24, 2026

Copy link
Copy Markdown

Adds a night vision curve so darker areas give more effect. Off by default, so nothing changes unless enabled.

Uses a GameRenderer mixin, with the Stonecutter guard for pre-26.2. Also re-enables the mixin block in build.forge.gradle.kts.

1.16.5-forge doesn't generate a refmap, so the mixin won't work there. Everything else is fine.

AI helped with strengthFor() and the fade in VisionHandler. Rest is mine.

FrCynda added 3 commits August 24, 2026 03:32
Night vision is all-or-nothing today: the toggle drops you straight into the
full potion effect. This makes it a curve instead - a lit strength, a dark
strength, the light level counted as lit, an exponent for the shape, and a
fade speed. VisionHandler recomputes the target every client tick and eases
towards it; a GameRenderer mixin returns that value from the night vision
scale so the vignette follows it.

Off by default (nv_curve = false), so nothing changes unless you turn it on.

The Forge mixin block in build.forge.gradle.kts was commented out because
there were no mixins to build a refmap from - there is one now, so it goes
back in.

scripts/NightVisionCurveCheck.java is a plain javac/java -ea check for the
curve maths, including the hand-edited-config values the sliders cannot reach.
Sliders for the five curve values plus the toggle, with English, German and
Austrian strings.
@MarioS271 MarioS271 self-assigned this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants