Fix warnings

This commit is contained in:
BruceChen 2026-04-06 20:32:38 +08:00
parent b6bfecc622
commit e81700bf0e
5 changed files with 28 additions and 39 deletions

View file

@ -803,7 +803,7 @@ public sealed class MccGameApi
{
Id = inventory.ID,
Type = inventory.Type.ToString(),
Title = inventory.Title,
Title = inventory.Title ?? string.Empty,
SlotCount = inventory.Type.SlotCount(),
Slots = slots,
Cursor = TryBuildCursorSnapshot(inventory)
@ -850,7 +850,7 @@ public sealed class MccGameApi
{
InventoryId = entry.Key,
InventoryType = inventory.Type.ToString(),
InventoryTitle = inventory.Title,
InventoryTitle = inventory.Title ?? string.Empty,
Slot = pair.Key,
ItemType = pair.Value.Type.ToString(),
TypeLabel = pair.Value.GetTypeString(),
@ -894,7 +894,7 @@ public sealed class MccGameApi
{
Id = entry.Key,
Type = entry.Value.Type.ToString(),
Title = entry.Value.Title,
Title = entry.Value.Title ?? string.Empty,
SlotCount = entry.Value.Type.SlotCount(),
NonEmptySlots = entry.Value.Items.Count(item => IsSnapshotInventorySlot(entry.Value, item.Key)),
Active = entry.Key > 0 && entry.Key == GetActiveContainerId(client)