mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
refactor: convert == null / != null to is null / is not null in 31 files
Replace old-style null comparisons with modern C# pattern matching syntax across Commands, Protocol, Mapping, ChatBots, Physics, Inventory, Logger, CommandHandler, Scripting, Crypto, and other modules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
446c6e7739
commit
c7bc25aa17
31 changed files with 77 additions and 77 deletions
|
|
@ -276,7 +276,7 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
|
||||
Container? inventory = handler.GetInventory(inventoryId.Value);
|
||||
if (inventory == null)
|
||||
if (inventory is null)
|
||||
return r.SetAndReturn(CmdResult.Status.Fail, string.Format(Translations.cmd_inventory_not_exist, inventoryId));
|
||||
|
||||
if (handler.CloseInventory(inventoryId.Value))
|
||||
|
|
@ -299,7 +299,7 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
|
||||
Container? inventory = handler.GetInventory(inventoryId.Value);
|
||||
if (inventory == null)
|
||||
if (inventory is null)
|
||||
return r.SetAndReturn(CmdResult.Status.Fail, string.Format(Translations.cmd_inventory_not_exist, inventoryId));
|
||||
|
||||
StringBuilder response = new();
|
||||
|
|
@ -307,7 +307,7 @@ namespace MinecraftClient.Commands
|
|||
response.AppendLine(String.Format(" #{0} - {1}§8", inventoryId, inventory.Title));
|
||||
|
||||
string? asciiArt = inventory.Type.GetAsciiArt();
|
||||
if (asciiArt != null && Settings.Config.Main.Advanced.ShowInventoryLayout)
|
||||
if (asciiArt is not null && Settings.Config.Main.Advanced.ShowInventoryLayout)
|
||||
response.AppendLine(asciiArt);
|
||||
|
||||
int selectedHotbar = handler.GetCurrentSlot() + 1;
|
||||
|
|
@ -342,7 +342,7 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
|
||||
Container? inventory = handler.GetInventory(inventoryId.Value);
|
||||
if (inventory == null)
|
||||
if (inventory is null)
|
||||
return r.SetAndReturn(CmdResult.Status.Fail, string.Format(Translations.cmd_inventory_not_exist, inventoryId));
|
||||
|
||||
string keyName = actionType switch
|
||||
|
|
@ -373,7 +373,7 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
|
||||
Container? inventory = handler.GetInventory(inventoryId.Value);
|
||||
if (inventory == null)
|
||||
if (inventory is null)
|
||||
return r.SetAndReturn(CmdResult.Status.Fail, string.Format(Translations.cmd_inventory_not_exist, inventoryId));
|
||||
|
||||
// check item exist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue