Merge pull request #3016 from BruceChenQAQ/master

Fix NullReferenceException in ConsoleIO
This commit is contained in:
BruceChen 2026-03-29 00:56:44 +08:00 committed by GitHub
commit 0d34d5e33d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 7 additions and 18 deletions

View file

@ -3,7 +3,6 @@ name: csharp-best-practices
description: >
C# 14 / .NET 10 coding conventions, idiomatic patterns, and performance best practices
for the Minecraft Console Client codebase. Use when writing, reviewing, or modifying C# code.
version: 0.4.0
---
# C# 14 / .NET 10 Best Practices

View file

@ -31,7 +31,6 @@ metadata:
- slow
- hang
- deadlock
version: 0.2.0
---
# C#/.NET CLI Optimization

View file

@ -7,7 +7,6 @@ metadata:
category: technique
triggers: performance, allocations, GC, hot path, latency, throughput,
memory pressure, optimize, slow, freeze, lag spike, packet processing speed
version: 0.2.0
---
# C# Performance Optimization for MCC

View file

@ -1,6 +1,5 @@
---
name: humanizer
version: 2.1.1
description: |
Remove signs of AI-generated writing from text. Use when editing or reviewing
text to make it sound more natural and human-written. Based on Wikipedia's

View file

@ -1,10 +1,6 @@
---
name: writing-skills
description: "Use when creating, updating, or improving agent skills."
category: meta
risk: unknown
source: community
date_added: "2026-02-27"
---
# Writing Skills (Excellence)

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)
{

View file

@ -161,14 +161,7 @@ namespace MinecraftClient
}
if (configResult.NeedWriteDefault)
{
Config.Main.Advanced.Language = Settings.GetDefaultGameLanguage();
WriteBackSettings(false);
}
else if (configResult.Success)
{
WriteBackSettings(true);
}
if (!Config.Main.Advanced.EnableSentry)
_sentrySdk?.Dispose();
@ -219,6 +212,8 @@ namespace MinecraftClient
if (cfg.NeedWriteDefault)
{
WriteBackSettings(false);
if (cfg.IsLegacyUpgrade)
{
ConsoleIO.WriteLineFormatted("§c" + Translations.mcc_use_new_config);
@ -243,6 +238,8 @@ namespace MinecraftClient
}
else
{
WriteBackSettings(true);
if (!Config.Main.Advanced.Language.StartsWith("en"))
ConsoleIO.WriteLine(string.Format(Translations.mcc_help_us_translate, Settings.TranslationProjectUrl));
}

View file

@ -1,6 +1,6 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "/"
"base_path": "./"
"preserve_hierarchy": true
"base_url": "https://api.crowdin.com"