1) The AutoRelog ChatBot stopped trying to log in after the 3rd attempt.
2) The AutoRelog ChatBot stopped trying to log in after the internet connection was interrupted. MCC froze.
2 problems have been solved.
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>
- 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
- 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>
* feat: implement interactive TUI inventory viewer
- Added InventoryTui command to open an interactive terminal user interface for inventory management.
- Introduced InventoryApp and InventoryMainView classes for TUI layout and functionality.
- Created InventoryViewModel and SlotViewModel to manage inventory data and display.
- Integrated Consolonia for enhanced console UI experience.
- Updated McClient to support console message handling during TUI operation.
These changes enhance user interaction with inventory management in Minecraft Console Client.
* feat: enhance debugging workflow with mcc-debug.sh and TUI support
- Introduced mcc-debug.sh for streamlined one-step build, server start, and MCC launch.
- Added TUI mode for improved user experience during debugging sessions.
- Updated mcc-env.sh to include new debug helpers and TUI mode functionality.
- Enhanced SKILL.md with detailed instructions for using the new debugging tools and console modes.
These changes significantly improve the debugging process for Minecraft Console Client, making it more efficient and user-friendly.
* feat: introduce TUI console backend and related enhancements
- Added ClassicConsoleBackend and TuiConsoleBackend to support different console I/O modes.
- Implemented IConsoleBackend interface for better abstraction of console operations.
- Enhanced ConsoleIO to utilize the new backend structure for input and output handling.
- Introduced MainTuiView and MccTuiApp for a full-screen TUI experience using Avalonia.
- Updated InventoryTuiHost to manage TUI lifecycle and interactions.
These changes significantly improve the console experience in Minecraft Console Client, providing a more flexible and user-friendly interface.
* refactor: remove InventoryTui command implementation
- Deleted the InventoryTui class, which provided an interactive terminal user interface for inventory management.
- This change simplifies the command structure as part of ongoing improvements to the console experience in Minecraft Console Client.
The removal of this command is aligned with recent enhancements to the console backend and user interface.
* refactor: update InventoryMainView and MainTuiView for improved UI handling
- Changed several fields from readonly to mutable in InventoryMainView to allow for dynamic updates.
- Introduced a new McColorParser class for parsing Minecraft color codes and creating colored text blocks.
- Enhanced MainTuiView to support formatted log lines and improved notification handling.
- Updated chat scrolling behavior to ensure better user experience during text input and log display.
These changes streamline the UI components and enhance the overall console experience in Minecraft Console Client.
* feat: enhance command input handling in MainTuiView
- Updated command input to use event routing for better key handling.
- Added support for Ctrl key shortcuts to improve text manipulation (e.g., word deletion, caret movement).
- Implemented text cleaning on input change to prevent newline characters.
- Improved health and food status bar rendering with a new method for building bar text.
These changes significantly enhance the user experience in the TUI by providing more intuitive command input functionality.
* feat: enhance TUI command suggestion functionality
- Introduced a new CommandSuggestion struct for backend-independent suggestion handling.
- Updated ConsoleIO to streamline suggestion updates for both Classic and TUI backends.
- Enhanced MainTuiView to display command suggestions with improved visibility and interaction.
- Increased the maximum number of displayed suggestions from 6 to 10 for better user experience.
These changes significantly improve the command input experience in the TUI, making it more intuitive and user-friendly.
* feat: enhance offline command autocomplete functionality
- Introduced an OfflineAutocompleteHandler to provide command suggestions for offline commands.
- Added support for tab cycling through suggestions in the TUI.
- Improved command input handling to clear suggestions when necessary and manage user input more effectively.
- Updated TuiConsoleBackend to integrate with the new autocomplete feature.
These changes significantly enhance the user experience by making command input more intuitive and responsive in offline scenarios.
* feat: enhance localization and user feedback in TUI
- Updated various TUI components to utilize localized strings for improved user experience.
- Enhanced debug state output with translated labels for better clarity.
- Improved inventory command help messages with localized text.
- Added new translations for console mode descriptions and inventory viewer prompts.
These changes significantly enhance the usability and accessibility of the TUI in Minecraft Console Client, making it more user-friendly and informative.
* feat: enforce localization for user-facing strings in AGENTS.md
- Added guidelines to ensure all user-facing text, including log messages and error messages, is managed through the translation system.
- Specified the use of `Translations.resx` and `Translations.Designer.cs` for localization, emphasizing the importance of avoiding hardcoded strings in source code.
These changes improve the consistency and accessibility of user-facing content across the application.
When AutoRelog was enabled and the server was offline (SocketException during
initial connection), AutoRelog's reconnection logic was never invoked. The
Retry block's else branch either called HandleFailure() without a disconnect
reason (so AutoRelog.OnDisconnectStatic was skipped) or did nothing at all.
Now the else branch directly calls AutoRelog.OnDisconnectStatic with the
standard "Connection has been lost" message (matching the default
Kick_Messages), ensuring reconnection is properly triggered.
FixesMCCTeam/Minecraft-Console-Client#2781
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/30698499-fdeb-44ce-9552-a64c4c5fb62b
- 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
- 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
Replace '== null' with 'is null' and '!= null' with 'is not null'
across 51 occurrences to use idiomatic C# pattern matching.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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>
- Introduced a comprehensive physics engine that replicates Minecraft's movement mechanics, including player input handling, gravity, and collision detection.
- Added classes for player physics, movement input, and collision detection, ensuring accurate simulation of player interactions with the game world.
- Integrated AABB (Axis-Aligned Bounding Box) structures for precise collision detection against blocks.
- Enhanced movement capabilities with support for jumping, sneaking, and sprinting, along with step-up mechanics for navigating terrain.
These changes significantly improve the realism and responsiveness of player movement within the game environment.