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
|
|
@ -172,7 +172,7 @@ namespace MinecraftClient.Inventory
|
|||
public int[] SearchItem(ItemType itemType)
|
||||
{
|
||||
List<int> result = new();
|
||||
if (Items != null)
|
||||
if (Items is not null)
|
||||
{
|
||||
foreach (var item in Items)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ namespace MinecraftClient.Inventory
|
|||
|
||||
public static Enchantments GetEnchantmentByRegistryId1206(int id)
|
||||
{
|
||||
if (dynamicEnchantmentIdMap != null && dynamicEnchantmentIdMap.TryGetValue(id, out var dynValue))
|
||||
if (dynamicEnchantmentIdMap is not null && dynamicEnchantmentIdMap.TryGetValue(id, out var dynValue))
|
||||
return dynValue;
|
||||
if (enchantmentMappings.TryGetValue((short)id, out var value))
|
||||
return value;
|
||||
|
|
@ -282,10 +282,10 @@ namespace MinecraftClient.Inventory
|
|||
|
||||
public static int GetRegistryId1206ByEnchantment(Enchantments enchantment)
|
||||
{
|
||||
if (reverseEnchantmentMappings == null)
|
||||
if (reverseEnchantmentMappings is null)
|
||||
{
|
||||
reverseEnchantmentMappings = new();
|
||||
if (dynamicEnchantmentIdMap != null)
|
||||
if (dynamicEnchantmentIdMap is not null)
|
||||
{
|
||||
foreach (var kvp in dynamicEnchantmentIdMap)
|
||||
reverseEnchantmentMappings[kvp.Value] = (short)kvp.Key;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue