Fix command registration for external MCC scripts

- Update Roslyn compiler LanguageVersion from CSharp9 to Latest
- Implement ChatBotCommand.RegisterCommand() (was empty)
- Add RegisterChatBotCommand() helper to ChatBot base class
- Add automatic command cleanup in BotUnLoad via UnregisterChatBotCommands()
- Fix external scripts using Handler.dispatcher (CS0176 static via instance)
- Fix AutoTree.cs wrong Initialize/OnUnload signatures (CS0115)
- EntityCount.cs RegisterChatBotCommand() now works with new helper

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/27fc44b8-50d8-4194-8057-019a29675d4a
This commit is contained in:
copilot-swe-agent[bot] 2026-03-24 17:43:14 +00:00
parent 34bc6c5400
commit 687d1746ed
7 changed files with 62 additions and 15 deletions

View file

@ -49,7 +49,7 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
private static CSharpCompilation GenerateCode(string sourceCode, string fileName, List<string> additionalAssemblies)
{
var codeString = SourceText.From(sourceCode);
var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.CSharp9);
var options = CSharpParseOptions.Default.WithLanguageVersion(LanguageVersion.Latest);
var parsedSyntaxTree = SyntaxFactory.ParseSyntaxTree(codeString, options);