Commit graph

85 commits

Author SHA1 Message Date
Anon
c282f2783c Fix legacy Farmer placement support 2026-05-03 15:46:16 +02:00
BruceChen
e81700bf0e Fix warnings 2026-04-06 20:36:12 +08:00
BruceChen
7fd70ccf38 fix: Support hex RGB colors (#RRGGBB) in chat messages (fixes #2054)
Minecraft 1.16+ servers can send custom hex colors in JSON text
components ("color": "#RRGGBB"). MCC's ChatParser.Color2tag() only
recognized the 16 named colors, silently dropping hex values and
leaving gradient/custom-colored chat as uncolored plain text.

- ChatParser: recognize hex color values and emit internal §#rrggbb
  encoding; extend ColorCodeRegex to match the new format
- ClassicConsoleBackend: resolve §#rrggbb to ANSI escape codes via
  ColorHelper before passing to ConsoleInteractive (adapts to the
  configured ConsoleColorMode: 24-bit, 8-bit, 4-bit, or disable)
- McColorParser (TUI): parse §#rrggbb into exact SolidColorBrush
  for full RGB fidelity in Avalonia
- ChatBot.GetVerbatim(): skip the full 8-char §#rrggbb sequence
  instead of only 2 chars, preventing hex digits from leaking into
  stripped text

Made-with: Cursor
2026-04-06 01:19:19 +08:00
Anon
f4c160979c Merge origin/master into feat/mcp-server 2026-04-03 20:03:37 +02:00
Anon
691057fe13 Bugfixes to the Looking and Movement. Added General prompt engineer. 2026-04-03 19:54:26 +02:00
Anon
dfef24ad10 Refactored to share the new utilities between the MCP and the Chat Bot API 2026-04-03 19:06:43 +02:00
copilot-swe-agent[bot]
fdbffcc5bb feat: add Teams packet support (parsing, state tracking, /teams command, bot API)
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/72ea891e-ba62-4dfc-bbba-f197cd1d0404

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-30 23:41:11 +00:00
Anon
c9b0913c1a feat(autofishing): add velocity and sound bite detection 2026-03-31 00:18:31 +02:00
Anon
be20b97478
Merge branch 'master' into copilot/implement-automatic-mining-handling 2026-03-30 19:13:39 +02:00
copilot-swe-agent[bot]
22455905a7 Add automatic mining-speed and dig-duration handling
- Add BlockHardness.cs with hardness data for all 1053 blocks from MC 1.21.11
- Add MiningCalculator.cs with version-aware dig duration computation
  - Tool speed from ToolComponent (1.20.6+) or legacy hardcoded tables
  - Efficiency enchantment (legacy: level^2+1, 1.21.11+: mining_efficiency attribute)
  - Haste/Conduit Power/Mining Fatigue effects
  - BLOCK_BREAK_SPEED attribute (1.20.6+)
  - MINING_EFFICIENCY and SUBMERGED_MINING_SPEED attributes (1.21.11+)
  - Underwater penalty with Aqua Affinity support (legacy) or attribute (modern)
  - Airborne penalty
  - Correct tool for drops check (30 vs 100 divisor)
- Modify McClient.DigBlock to auto-compute duration for survival/adventure mode
- Cache player attributes from OnEntityProperties in McClient
- Expose duration parameter in ChatBot.cs scripting wrapper
- Add /downloads/ to .gitignore

Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/579df446-a335-4174-9a8b-4d66173c82b1

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-30 08:24:00 +00:00
copilot-swe-agent[bot]
65ef3dde6b Implement unified achievements feature: data model, protocol handling, state management, ChatBot API, and /achievement command
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/9db483a8-4a5f-47b1-a6f4-30b6e39075bd

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 20:22:31 +00:00
Anon
f6446b198d Implemented effects support, as a command, chat notification and added in TUI mode 2026-03-27 15:47:27 +01:00
copilot-swe-agent[bot]
eeb4383099 Fix Roslyn compiler references for WebSocket/HttpListener and fix MCCScript using directive semicolons
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/6fa57d65-60be-4a4b-b15a-ad3541ac6de3
2026-03-25 14:32:39 +00:00
copilot-swe-agent[bot]
802cc696d6 fix sample http request script on latest runtime
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/9bf31c0e-e47b-4654-be10-6ea50f27a581
2026-03-24 19:44:05 +00:00
copilot-swe-agent[bot]
9eba4d026c Improve UnregisterChatBotCommands doc comment per review feedback
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d34fe951-43e5-412d-8d7f-cf9bee3a0d77
2026-03-24 18:15:01 +00:00
copilot-swe-agent[bot]
da3b2de2ce Fix Roslyn compiler missing netstandard/System.Runtime references (CS0012)
Add netstandard.dll and System.Runtime.dll as metadata references in both
the self-contained and non-self-contained compilation paths. These facade
assemblies are required when scripts reference libraries targeting
netstandard (e.g. Brigadier.NET), preventing CS0012 errors like:
"The type 'Object' is defined in an assembly that is not referenced."

Also make the self-contained path resilient to missing facade assemblies
by catching FileNotFoundException instead of throwing.

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d34fe951-43e5-412d-8d7f-cf9bee3a0d77
2026-03-24 18:10:04 +00:00
copilot-swe-agent[bot]
54e07cd233 Address review: use TrimEntries in ChatBotCommand args split for consistency
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
2026-03-24 17:44:35 +00:00
copilot-swe-agent[bot]
687d1746ed 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
2026-03-24 17:43:14 +00:00
copilot-swe-agent[bot]
81b756292e Fix all compilation warnings (CS9107, CS8600, CS8604, CS8618, CS0168, CS0169, CS0649)
- Fix CS9107: Replace lowercase primary constructor parameter refs with
  PascalCase base class properties in 90+ StructuredComponent files
- Fix CS8618: Add null! initializers for late-initialized properties
- Fix CS8600: Use nullable out parameters in World.cs, ChatParser.cs
- Fix CS8604: Add null guard in Compiler.cs, fix null-conditional in McClient.cs
- Fix CS0168: Replace unused variable with discard in DataTypes.cs
- Fix CS0169: Remove unused motionY field from McClient.cs
- Fix CS0649: Remove never-assigned steps field, simplify ClientIsMoving()
- Initialize client/handler with null! to avoid CS8618 cascade

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/milutinke/Minecraft-Console-Client/sessions/7fcee1b2-21e2-4457-b01b-5e0a1f07752f
2026-03-24 01:25:50 +00:00
copilot-swe-agent[bot]
c7bc25aa17 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>
2026-03-24 00:42:59 +00:00
copilot-swe-agent[bot]
2ae31e269f Convert switch statements to expressions and adopt collection expressions
- DirectionExtensions.cs: Convert GetOpposite() to switch expression,
  use file-scoped namespace, use collection expression for HORIZONTAL
- McClient.cs: Convert InteractType switch to expression, use collection
  expressions for array literals
- Protocol18.cs: Replace Array.Empty<byte>() with [], use collection
  expressions for byte/int array literals
- DataTypes.cs: Use collection expression for TAG_End byte array
- ChatBot.cs: Use collection expressions for string/char arrays
- Location.cs: Use collection expressions and modernize null check

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/milutinke/Minecraft-Console-Client/sessions/4e9bd25b-22c5-47c2-98f9-6025d927b1d6
2026-03-24 00:34:00 +00:00
copilot-swe-agent[bot]
c5df6a49c6 Modernize null-check patterns: use 'is null' and 'is not null'
Replace '== null' with 'is null' and '!= null' with 'is not null'
across 19 core files following modern C# pattern matching conventions.

Only literal null comparisons are changed. Assignments, value
comparisons, and LINQ expressions are left untouched.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 00:28:02 +00:00
copilot-swe-agent[bot]
74def7c512 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>
2026-03-24 00:15:21 +00:00
Anon
484133f07a Run MCC at true 20 TPS 2026-03-23 14:29:04 +01:00
copilot-swe-agent[bot]
15aabd9423 Replace legacy custom JSON parser with System.Text.Json
- Rewrite Json.cs to use System.Text.Json.Nodes (JsonNode, JsonObject, JsonArray)
- Add JsonNodeExtensions.GetStringValue() for backward-compatible string access
- Update all 14 consumer files to use the new JsonNode API
- Remove ~300 lines of hand-rolled JSON parsing code from 2013
- Replace KeyUtils.EscapeString with delegation to Json.EscapeString

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/milutinke/Minecraft-Console-Client/sessions/afcd1b7b-ea23-4a0d-bb46-a90b623406fc
2026-03-22 16:39:26 +00:00
Anon
28834e7a86 Implemented .net 10 support. Updated all affected libraries and the code. Not testes yet. 2026-03-21 20:07:20 +01:00
breadbyte
494be0930b
Merge branch 'master' into 1.20.6 2025-12-02 00:06:16 +08:00
Anon
2409de2a2f
Fix prevent AntiCheat Block Breaking (In Scripts)
Fix prevent AntiCheat Block Breaking (In Scripts)
2024-12-25 16:56:07 +01:00
Anon
76e873ed54 WIP: Added some strctured components 2024-09-11 19:12:31 +02:00
breadbyte
ca966a464c
Ensure that the cached version of MCC is refreshed every update (#2760)
fixes #2758

this happened because we added sentry in a future release, but the cache was using an old executable, so it couldn't find the assembly.
2024-07-14 01:46:43 +08:00
breadbyte
8756ff5b3c
[skip ci] Miscellaneous scripting QoL improvements and fixes (#2740)
* Update CI to detect the word "skipci"

* Make script compilation errors more verbose

Rather than just giving the line in which the error has been found, return the actual text content of the line itself

* Attempt to bubble up errors in the script chain, so it says the reason for any NotRun errors.

The exception message gets eaten up when the script is running, and an exception happens.

Also put in a default result message for the CmdResult, instead of having it default to null.

* Trim the whitespace off returned script compilation error line
2024-06-22 06:40:23 +08:00
yaggod
d0caf4c9ee fixed typo in word heAlper lol 2024-04-16 21:21:08 +03:00
Roman Danilov
df9443381b Done auxiliary methods for Direction 2024-03-05 21:49:29 +05:00
Roman Danilov
fde50c1728 AntiCheat fix prevent Block Breaking 2024-03-05 18:54:29 +05:00
Anon
790e0bfe55 Implemented 1.20.3 2024-01-30 12:51:47 +01:00
Anon
782481816d Implemented TabListHeaderAndFooter packet 2023-11-20 18:08:09 +01:00
Domracz
1aea8d3a4e
Fixed entity rotations (#2596)
* Fixed entity rotations

Fixed entity yaw and pitch not changing when entity moves head.

* Update ChatBot.cs

* Update McClient.cs

* Update Protocol18.cs

* Update McClient.cs

* Finalize code style

* Fix incorrect variable type

---------

Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
2023-10-11 14:44:46 +08:00
Spongecade
c3fa413b4e
[skip ci] Update Minecraft wiki links to new domain (#2593) 2023-10-07 17:59:08 +08:00
Anon
272900d52e Added slab handling for 1.20/.1
Added Farm bot crops handling for 1.20/.1
Added utilities for Containers/Inventories
Added bot movement lock to prevent multiple bots that use movements from running at the same time.
General code improvements.
2023-06-23 16:25:18 +02:00
Anon
1efa55206f Re-added WebSocketChat bot and improved it, no longer using WebsocketSharp library 2023-05-27 19:46:28 +02:00
Anon
0a57c927d7 Added access to App Vars inside the Chat Bot API via 3 new methods. Added access to Random class inside the execif command 2023-03-31 18:17:03 +02:00
breadbyte
74d29321b4
Scripting Hotfix for #2458 (#2460)
* Scripting hotfix

- Fixes #2458
- Change error wording around scripting
- Prevent duplicating the binary for scripting

* Create temporary folder if it doesn't exist
2023-03-28 21:06:56 +08:00
BruceChen
9c8afb7d3c Bug fix 2023-01-02 18:52:49 +08:00
BruceChen
94a3c92b36 Bug fix 2022-12-11 16:30:45 +08:00
BruceChen
892999ac98 Merge into master 2022-12-06 20:32:46 +08:00
BruceChen
84cf749344 Implement command completion suggestions. 2022-12-06 15:50:17 +08:00
BruceChen
ef39e8329c [SKIP_BUILD] Change file encoding to UTF-8 with BOM 2022-11-28 13:55:05 +08:00
BruceChen
5d2589b10f Merge remote-tracking branch 'origin/master' into brigadier-dev 2022-11-07 15:39:46 +08:00
BruceChen
ae23ead4c3 [SKIP_BUILD] FIx "/reco" and "/connect" not working properly 2022-11-05 20:27:10 +08:00
BruceChen
f2f88ac009 Merge master into brigadier-dev 2022-10-29 11:44:54 +08:00