mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Modernize lock object declarations from object to System.Threading.Lock
Replace all lock object declarations using 'object' type with the C# 13 System.Threading.Lock type across 12 files. The Lock type provides a more efficient locking mechanism - when used with lock(), the compiler automatically uses Lock.EnterScope() instead of Monitor.Enter/Exit. Also made two previously non-readonly lock fields readonly: - McClient.DigLock - Protocol18.MessageSigningLock Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e09b997cdf
commit
74def7c512
12 changed files with 24 additions and 16 deletions
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using Brigadier.NET;
|
||||
using MinecraftClient.CommandHandler;
|
||||
using MinecraftClient.Inventory;
|
||||
|
|
@ -42,7 +43,7 @@ namespace MinecraftClient.Scripting
|
|||
private McClient? _handler = null;
|
||||
private ChatBot? master = null;
|
||||
private readonly List<string> registeredPluginChannels = new();
|
||||
private readonly object delayTasksLock = new();
|
||||
private readonly Lock delayTasksLock = new();
|
||||
private readonly List<TaskWithDelay> delayedTasks = new();
|
||||
protected McClient Handler
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue