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:
copilot-swe-agent[bot] 2026-03-24 00:42:59 +00:00
parent 446c6e7739
commit c7bc25aa17
31 changed files with 77 additions and 77 deletions

View file

@ -51,7 +51,7 @@ namespace MinecraftClient.CommandHandler.ArgumentType
string[] args = builder.Remaining.Split(' ', StringSplitOptions.TrimEntries);
if (args.Length == 0 || (args.Length == 1 && string.IsNullOrWhiteSpace(args[0])))
{
if (client != null)
if (client is not null)
{
Location current = client.GetCurrentLocation();
builder.Suggest(string.Format("{0:0.00}", current.X));
@ -68,7 +68,7 @@ namespace MinecraftClient.CommandHandler.ArgumentType
else if (args.Length == 1 || (args.Length == 2 && string.IsNullOrWhiteSpace(args[1])))
{
string add = args.Length == 1 ? " " : string.Empty;
if (client != null)
if (client is not null)
{
Location current = client.GetCurrentLocation();
builder.Suggest(string.Format("{0}{2}{1:0.00}", builder.Remaining, current.Y, add));
@ -83,7 +83,7 @@ namespace MinecraftClient.CommandHandler.ArgumentType
else if (args.Length == 2 || (args.Length == 3 && string.IsNullOrWhiteSpace(args[2])))
{
string add = args.Length == 2 ? " " : string.Empty;
if (client != null)
if (client is not null)
{
Location current = client.GetCurrentLocation();
builder.Suggest(string.Format("{0}{2}{1:0.00}", builder.Remaining, current.Z, add));

View file

@ -87,7 +87,7 @@ namespace MinecraftClient.CommandHandler
public override string ToString()
{
if (result != null)
if (result is not null)
return result;
else
return status.ToString();