Refactor ConsoleIO and Program settings handling

- Updated ConsoleIO to allow writing to the console when Backend is null, improving error handling.
- Simplified settings write-back logic in Program.cs to ensure default settings are written correctly based on configuration results.
This commit is contained in:
BruceChen 2026-03-29 00:54:34 +08:00
parent f0fda8ce9f
commit 9cada9d19d
2 changed files with 6 additions and 9 deletions

View file

@ -104,7 +104,7 @@ namespace MinecraftClient
/// </summary>
public static void WriteLine(string line)
{
if (BasicIO)
if (BasicIO || Backend is null)
Console.WriteLine(line);
else
Backend.WriteLine(line);
@ -137,7 +137,7 @@ namespace MinecraftClient
{
str = str.Replace('\n', ' ');
}
if (BasicIO)
if (BasicIO || Backend is null)
{
if (BasicIO_NoColor)
{