Skip to content

Planet weather depth: atmosphere gate, acid rain, real weather control#21

Open
StannisMod wants to merge 2 commits into
1.12from
feature/better_weather
Open

Planet weather depth: atmosphere gate, acid rain, real weather control#21
StannisMod wants to merge 2 commits into
1.12from
feature/better_weather

Conversation

@StannisMod

Copy link
Copy Markdown
Owner

Summary

Closes logical gaps in how planet weather interacts with vanilla/AR mechanics — no brand-new weather mechanics (no dust/sand storms), only compatibility fixes plus acid rain.

  • Atmosphere gate. Planet rain/thunder is now gated on a configurable minAtmosphereDensityForRain (default 75): thin/airless worlds stay clear regardless of weather markers. Fixes the inconsistency where rainMarker=1 could "rain" on a vacuum moon.
  • Thunder requires rain. updateWeather enforces that thunder can't exist without rain (vanilla couples them — lightning only strikes where it's raining, thunder strength is scaled by rain strength). thunderMarker=1 + rainMarker=-1 no longer leaves a dead storm flag.
  • Weather Controller actually controls weather. The satellite/remote rain/dry modes now drive the planet's rain marker (rain → always, dry → clear) in addition to their existing water-flooding behaviour; flood leaves weather untouched. Marker is handed back when the controller is removed.
  • Acid rain. New per-planet acidicRain flag (XML + NBT + client sync via PacketDimInfo). Unprotected players under open acidic rain take damage (acidRainDamage / acidRainDamageInterval config); a full protective suit shields them, independent of breathability. Falling rain is tinted green client-side via an EntityRenderer.renderRainSnow mixin.
  • Surfacing. New /ar planet weather [dim] prints the weather profile, atmosphere-gate status, current state and the tick countdown to the next change. (Profile values are also editable through the existing /ar planet get|set.)
  • Bug fix (ledger Many bugfixes, so many that I can not even list them all + terraforming update #1 #8). canDoRainSnowIce compared the /100-normalized density against the literal 75, so it was effectively always false — AR planets never accumulated rain/snow/ice through that gate. Now uses the raw 0..100 density vs the config threshold.

Note on vanilla weather

Verified against decompiled MC: vanilla weather is a single global flag, filtered per-biome at the manifestation level (snow vs rain vs nothing) — it is not async-by-biome, so nothing was re-invented there. Vanilla has no "dry storm", so that idea was dropped in favour of the thunder-requires-rain invariant.

Test plan

  • testUnit + testIntegration green — added acidicRain NBT round-trip (DimensionPropertiesTest) and XML parse/default (XMLPlanetLoaderTest).
  • testServer (filtered) 12/12 green — new PlanetWeatherGateTest (thin atmosphere suppresses rain despite rainMarker=1; thick allows it; thunderMarker=1+rainMarker=-1 → no thunder) + no regression in existing weather/atmosphere suites.
  • Real client on display :100 (Mesa/llvmpipe GL): MixinAcidRainRender applies into EntityRenderer at runtime with no injection error; client boots clean.
  • Not yet eyeballed: the literal green rain pixels on an acidic planet need a manual look in a live GPU session (visual-regression is out of scope). Risk is low — the tint is an identity multiply for non-acid worlds and the redirect resolved at runtime.

Compatibility

  • The render mixin uses require = 0 so an OptiFine-rewritten renderRainSnow cannot abort the (required) mixin config — it silently skips the tint instead.
  • No registry-name or NBT-shape breaks; acidicRain is additive and defaults to false.

… control

- Gate planet rain/thunder on minAtmosphereDensityForRain config
- Enforce thunder-requires-rain invariant in updateWeather
- Fix canDoRainSnowIce density scale bug (ledger #8)
- Weather Controller rain/dry modes now drive the planet rain marker
- Add acidicRain planet flag with NBT + XML round-trip
- Damage unprotected players under open acidic rain, config-gated
- Add /ar planet weather command for profile + live state
- Tests: acidicRain round-trips, atmosphere gate, thunder invariant
- Redirect renderRainSnow GL colour to a green tint on acidicRain planets
- require=0 so OptiFine-rewritten renderRainSnow cannot abort the config
- acidicRain flag reaches the client through PacketDimInfo
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.

1 participant