Commit graph

1638 commits

Author SHA1 Message Date
BruceChen
6e86edc632 feat: Refactor MapColors class to load color palette from JSON resource 2026-04-05 01:17:57 +08:00
Anon
76c3403700
feat: Added a /tab command to display the list of online players 2026-04-04 16:21:06 +02:00
Anon
c8286f60c1 Added a /tab command 2026-04-04 16:17:49 +02:00
Anon
23262de6c2
bugfix: Fixed teams packet crash 2026-04-04 14:32:12 +02:00
Anon
a12ba29c45 Fixed teams packet crash 2026-04-04 14:30:44 +02:00
Anon
1ca023be36 Added a Github star reminder 2026-04-03 21:15:02 +02: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]
744dcd73cd
Fix TPS calculation: clamp values above 20 instead of discarding them
The old code filtered out any instantaneous TPS sample > 20 with
`if (tps <= 20 && tps > 0)`. Because time-update packets arrive with
OS/network jitter, many measurements on a healthy server land slightly
above 20.0 and were silently discarded, leaving only sub-20 samples in
the rolling average. This caused the reported TPS to be virtually always
lower than the true server TPS.

A Minecraft server cannot genuinely run faster than 20 TPS (it sleeps
for the remainder of each 50 ms tick budget), so any measurement above
20 is definitionally timing noise. Clamp to Math.Min(tps, 20.0) instead
of discarding the sample so a healthy server's rolling average converges
to 20.0 as expected.

Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/826926c5-78fa-4059-ab8f-4abd209f120d

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-04-03 16:24:38 +00:00
Anon
22e987070a Merge remote-tracking branch 'origin/master' into feat/optimization
# Conflicts:
#	tools/run-creative-e2e.sh
2026-04-03 15:44:59 +02:00
BruceChen
512445cb1d fix: prevent TUI StackOverflowException from excessive log controls
The TUI log view used an ItemsControl with 5000 max entries and no UI
virtualization. Avalonia's composition renderer traverses the entire
visual tree on each frame -- with thousands of TextBlock controls, the
recursive Render/RenderCore calls exceed the thread stack size on
constrained devices (especially ARM where each stack frame is larger
due to ABI differences), causing a StackOverflowException in
ServerCompositionContainerVisual.Render.

Changes:
- Enable VirtualizingStackPanel on the log ItemsControl so Avalonia
  only creates visuals for the rows currently in the viewport.
- Add [Console.General] TUI_Log_Scrollback config option so users can
  control max log lines in TUI mode. Default is 0 (automatic: 3000 on
  x86/x64, 500 on ARM/ARM64).

Made-with: Cursor
2026-04-03 03:17:53 +08:00
BruceChen
2003786608 fix: resolve AutoRelog reconnect errors (#3036)
- Reset _BotRecoAttempts on successful game join so retry counter
  does not carry stale state across sessions
- Display "unlimited" instead of near-int.MaxValue retry count when
  Retries is set to -1 (infinite)
- Guard SendText with CanSendMessage check to prevent
  NullReferenceException when bots call send after disconnect
- Catch SocketException/IOException in Protocol18 Updater thread so
  a closed socket triggers OnConnectionLost gracefully instead of an
  unhandled exception

Made-with: Cursor
2026-04-03 01:28:26 +08:00
BruceChen
2441c67178 fix: work around Consolonia libcoreclr.so DllNotFoundException on Linux single-file publish
Consolonia's Unix.Terminal uses [DllImport("libcoreclr.so")] to load
dlopen/dlsym on .NET Core. It ships a SetDllImportResolver that maps
the library name to the current process handle, but the resolver is
guarded by #if NET6_0 (exact TFM match) instead of NET6_0_OR_GREATER.
Since Consolonia targets net8.0, the resolver is never compiled in.

On self-contained single-file publishes, libcoreclr.so is bundled
inside the host binary and does not exist on disk. Without the
resolver the OS linker cannot find it, causing a DllNotFoundException
that crashes the TUI on startup. This primarily affects ARM64 Linux
users (e.g. Raspberry Pi / Debian Trixie) who almost exclusively use
self-contained publishes.

This commit registers an AssemblyLoadContext.Default.ResolvingUnmanagedDll
handler in Program.Main (before TUI init) that returns (IntPtr)(-1) for
libcoreclr.so, which the runtime interprets as the current process.

This is a temporary workaround until the upstream fix lands:
https://github.com/Consolonia/Consolonia/pull/605

Made-with: Cursor
2026-04-03 01:11:36 +08:00
milutinke
a88ca3cb71 Improved the guidance prompt 2026-04-01 13:55:18 +02:00
milutinke
fc05d2c98c Fixed item dropping issue. 2026-04-01 13:45:12 +02:00
milutinke
ee6eb84bd8 Improved the Web Based Harness 2026-04-01 13:45:12 +02:00
copilot-swe-agent[bot]
737a94475a fix: clarify autodig switch log formatting
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/e83f9c2a-a85c-4763-821b-c5b4a0db75a6

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-31 08:50:43 +00:00
copilot-swe-agent[bot]
1a86655dfb feat: add autodig tool switching
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/e83f9c2a-a85c-4763-821b-c5b4a0db75a6

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-31 08:44:23 +00: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
c3c57c058a Moved the operator prompt from a skill to an embedded resourcce 2026-03-30 23:21:36 +02:00
Anon
968800b95a Added a bunch of new useful MCP Tools 2026-03-30 23:14:28 +02:00
Anon
d5358d3d1a
feat: Add automatic mining-speed and dig-duration handling 2026-03-30 21:41:06 +02:00
Anon
5de72de234 Fixed a wrong effect decoding on 1.20.4 2026-03-30 21:37:53 +02:00
Anon
d158bfdf21 Fixed bugs 2026-03-30 20:20:58 +02:00
BruceChen
35dd3c4f06 Add support for ItemStackTemplate in DataTypes and Protocol18
- Implemented ReadNextItemStackTemplate method to read ItemStackTemplate data with item-first encoding.
- Updated Protocol18 to utilize ReadItemStackTemplateLabel for improved item display handling.
- Enhanced item component parsing to accommodate new structured components.
2026-03-31 01:28:24 +08:00
BruceChen
eae96a8fbc Cave mode for minimap 2026-03-31 01:28:24 +08:00
Anon
be20b97478
Merge branch 'master' into copilot/implement-automatic-mining-handling 2026-03-30 19:13:39 +02:00
BruceChen
435887cc04 Update translation for banner label to clarify supported Minecraft versions 2026-03-31 00:05:22 +08:00
BruceChen
f7bc817408 Refactor color definitions in MccBannerPanelBuilder for improved clarity
- Removed unused color definitions for screen and dark screen.
- Updated pixel array to use the new screen background color consistently.
- Adjusted prompt text colors for better visibility in the TUI.
2026-03-31 00:03:29 +08:00
BruceChen
eaf4704473 Add icon banner display option and refactor startup banner logic
- Introduced a configuration option `Display_Icon_Banner` to control the visibility of the startup icon banner.
- Refactored `ProcessStartupState` to utilize TUI for displaying the banner if enabled, falling back to a classic banner display otherwise.
- Added new methods for building the banner panel and icon grid for improved visual representation.
- Updated translations and resource comments to support the new banner features.
2026-03-31 00:03:29 +08:00
milutinke
0881cbaa1c Fix legacy achievements and add test harness 2026-03-30 17:25:08 +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]
962c8b1ab2 Fix 26.1 RecipeBookAdd crash: update SlotDisplay registry IDs for 26.1
MC 26.1 changed the minecraft:slot_display registry, inserting 3 new
types (with_any_potion, only_with_component, dyed) and shifting all
existing IDs. This caused MCC to misparse recipe display data, leading
to a Queue empty crash in SkipItemHolderSet.

Add version-gated ReadSlotDisplayLabel with correct 26.1 type mapping
and reader methods for the 3 new slot display types.

Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/47b0c937-1491-4216-8ee0-1aca866e99ab

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-30 08:09:33 +00:00
copilot-swe-agent[bot]
0f3289dfdf Fix criteria version boundary: criteria list removed from wire format in MC 1.20.2, not 1.20.6
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/5da0ec37-35e2-4aae-b165-66ddd82df985

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 21:16:45 +00:00
copilot-swe-agent[bot]
5705df43bd Fix Advancements packet parsing: sendsTelemetryEvent added in 1.20, deduplicate requirements reading
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/5da0ec37-35e2-4aae-b165-66ddd82df985

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 21:07:17 +00:00
copilot-swe-agent[bot]
7b3e5ee492 Address code review: eliminate unnecessary allocation in progress-only updates
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:27:12 +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
ef106c80c2
feat: Implemented the Recipe Book into MCC 2026-03-29 21:05:38 +02:00
Anon
7b415d5388 Added a Skill for MCP 2026-03-29 20:57:16 +02:00
BruceChen
90ea05b17d Enhance server status display and player information handling
- Updated `ServerStatusDisplay` to use `ChatBot.GetVerbatim` for version name formatting.
- Modified `ServerStatusPanelBuilder` to improve player name display with color parsing.
- Changed translation for online player label to "Online Players:" for clarity.
- Refactored protocol version checks to streamline logic in server status handling.
2026-03-30 02:46:34 +08:00
copilot-swe-agent[bot]
b05c8cfe0d fix: support 1.21.11 recipe book display ids
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/4cdf26f2-112b-4502-88f7-8f589c424f69

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 18:45:14 +00:00
copilot-swe-agent[bot]
dfc1164839 chore: finalize recipe book support polish
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/00c8527f-5755-43c1-8916-8d571d28860b

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 18:12:01 +00:00
copilot-swe-agent[bot]
893be203e5 chore: polish recipe book support
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/00c8527f-5755-43c1-8916-8d571d28860b

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 18:07:09 +00:00
copilot-swe-agent[bot]
d5308ba8c6 feat: add recipe book command support
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/00c8527f-5755-43c1-8916-8d571d28860b

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
2026-03-29 18:00:44 +00:00
BruceChen
871305bd72 Add server status display and protocol version upgrade handling
- Introduced a new `ServerStatusInfo` class to encapsulate server status data including MOTD, player counts, and version information.
- Implemented `ServerStatusDisplay` to format and display server status information in both classic and TUI modes.
- Added protocol version upgrade logic in `ProtocolHandler` to determine the highest supported protocol version for multi-version servers.
- Updated translations to support new server status labels and messages.
- Created `ServerStatusPanelBuilder` for TUI to visually represent server status with player information and connection details.
2026-03-30 01:39:37 +08:00
BruceChen
2f03f66f5c Enhance useblock command to support hand selection
- Updated the 'useblock' command to allow specifying the hand (mainhand or offhand) for block placement.
- Modified command usage description to reflect the new optional parameter.
- Adjusted the command execution logic to handle the selected hand during block placement.
2026-03-29 22:40:43 +08:00
BruceChen
d05e3148f1 Refactor explosion packet handling for protocol version updates
- Updated explosion packet processing to accommodate changes in Minecraft protocol versions, specifically for versions 1.21.2 and 1.20.4.
- Removed obsolete fields such as explosion strength and block records for newer versions, and added support for optional knockback and particle data.
- Enhanced backward compatibility for earlier versions by maintaining existing logic for explosion data retrieval.
2026-03-29 22:40:43 +08:00
BruceChen
d427a6e160 Add tooltip service and integrate with MinimapControl
- Introduced TuiTooltipService for managing tooltips across TUI components.
- Updated MinimapControl to utilize the new tooltip service for enhanced entity information display.
- Refactored tooltip rendering logic to improve visibility and interaction based on mouse position.
2026-03-29 19:53:50 +08:00