Skip to content

Fix day/night length application in NTimeManager - #6

Open
VibeCodeMonster wants to merge 4 commits into
mainfrom
20il8n-codex/fix-day/night-lengths-in-ntimemanager
Open

Fix day/night length application in NTimeManager#6
VibeCodeMonster wants to merge 4 commits into
mainfrom
20il8n-codex/fix-day/night-lengths-in-ntimemanager

Conversation

@VibeCodeMonster

Copy link
Copy Markdown
Owner

Motivation

  • The plugin sometimes failed to apply day/night durations to the TOD cycle and printed "Could not apply day/night lengths via TOD cycle parameters.".
  • Servers that ignore direct TOD cycle values still accept console env variables, so a fallback is needed to reliably set durations.

Description

  • Refreshes the TOD cycle after setting cycle fields by adding TryRefreshCycle(sky.Cycle) which invokes Refresh or Update if available.
  • Adds a fallback that sets console variables env.daylength and env.nightlength via ConsoleSystem.Run.Server.Quiet using TrySetEnvLength when direct cycle members are not effective.
  • Uses invariant formatting with CultureInfo.InvariantCulture when sending float values to the console to avoid locale issues.
  • Adjusts the warning logic to only warn if both the cycle and env fallbacks failed to apply lengths.

Testing

  • No automated tests were run for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant