mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Refactored to share the new utilities between the MCP and the Chat Bot API
This commit is contained in:
parent
a88ca3cb71
commit
dfef24ad10
12 changed files with 2225 additions and 1027 deletions
|
|
@ -48,6 +48,7 @@ namespace MinecraftClient.Scripting
|
|||
private readonly List<string> registeredChatBotCommands = new();
|
||||
private readonly Lock delayTasksLock = new();
|
||||
private readonly List<TaskWithDelay> delayedTasks = new();
|
||||
private MccGameApi? _game;
|
||||
protected McClient Handler
|
||||
{
|
||||
get
|
||||
|
|
@ -60,6 +61,11 @@ namespace MinecraftClient.Scripting
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shared gameplay and observed-state API used by MCP and available to built-in bots and scripts.
|
||||
/// </summary>
|
||||
protected MccGameApi Game => _game ??= new MccGameApi(() => Handler);
|
||||
|
||||
/// <summary>
|
||||
/// Will be called every client tick (~50ms at 20 TPS).
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue