Add a nullable `Nbt` field to `MccInventorySnapshotSlot`,
`MccInventorySearchMatch`, and `MccItemStackSnapshot` so that callers
can access the full item metadata beyond just material and count.
For 1.20.6+ servers the field is a map of component name
(e.g. "minecraft:custom_data") to the serialized component object.
For legacy servers it is the raw NBT dictionary. The field is omitted
entirely for vanilla items that carry no extra data, so there is no
noise for plain items like Stone or Dirt.
Implementation:
- `StructuredComponent`: add `ComponentName` property (set by the
registry during parse) and mark both it and `TypeId` with
`[JsonIgnore]` so they are excluded from component serialization.
- `StructuredComponentRegistry.ParseComponent`: assign `ComponentName`
after instantiation.
- `MccGameCommon.BuildNbt`: new helper that serializes components by
runtime type (fixing the polymorphism issue with System.Text.Json)
keyed by component name, falling back to the legacy NBT dictionary.
- Snapshot and search query builders updated to call `BuildNbt`.
# Submission Instructions
## Content of this submission
### 1. Synchronize official CSharpRunner.cs
- Synchronize `CSharpRunner.cs` to the latest official version
- **Removed** extended support for non-standard metadata formats (XML, C# style, JS style)
- Restore to the official standard metadata parsing method
### 2. Migrate DataPath.cs
- Migrate `DataPath.cs` to the new version of the code repository
- Maintain the original functionality unchanged:
- `DataPath.Init("ScriptName")` - create a configuration folder
- `DataPath.Get()` - Gets the path of the configuration folder
## Reason for change
1. **Facilitate official merging**: Retaining custom metadata formats increases the risk of conflicts with the official codebase. Removing them allows for smoother acceptance of official updates
2. **Reduce maintenance costs**: The official CSharpRunner.cs undergoes frequent changes, making the maintenance of custom branches a significant workload
3. **Maintain consistency**: Keep consistent with the official version to avoid compatibility issues caused by format differences
## Scope of impact
- Previously supported non-standard metadata formats (XML, C# style, JS style) will no longer be recognized
- Only supports official standard metadata formats
- The functionality of DataPath.cs remains unaffected, and the configuration management function is still operational and available
## Remarks
- DataPath.cs and CSharpRunner.cs have previously been modified, and this time it is only for migration and synchronization purposes
- AI-assisted participation was involved in the previous modification process
Prevents NullReferenceException crash when receiving player head items
with an empty or absent profile name. The Minecraft protocol permits
empty names in the profile component; the serialization path now
falls back to an empty string instead of throwing.
After the dialog system PR (#3143), ResolveHexColors in ClassicConsoleBackend
mapped every §#RRGGBB hex color to the nearest of 16 standard Minecraft colors
via NearestMcColor. This meant all server-sent hex colors were downgraded to
4-bit ANSI regardless of the user's ConsoleColorMode setting.
Replaced the nearest-color lookup with ColorHelper.GetColorEscapeCode, which
generates the right output for each mode: 24-bit ANSI in vt100_24bit mode, 8-bit
in vt100_8bit, 4-bit in vt100_4bit, ConsoleColor in legacy_4bit.
Fixes#3146.
- Change empty packet log from log.Warn to log.Debug so it only
shows when DebugMessages is enabled
- Add PacketDebugExclusions config (List<string>) to suppress
specific packet types like KeepAlive, Ping from packet debug output
- Check exclusion in both LogIncomingPacket and LogOutgoingPacket
- Add ConfigComments resource entry for the new setting
Script ChatBots were persisted in the static botsOnHold list across
reconnects. When ScriptScheduler triggered new scripts on login, the
old Script bots were still running, causing duplicate commands to be
sent simultaneously. This led to command spam and crashes.
Adding OnDisconnect to the Script ChatBot ensures scripts are removed
from the bots list before they can be saved to botsOnHold, preventing
accumulation of duplicate script instances on reconnect.