-
-
Notifications
You must be signed in to change notification settings - Fork 64
feat: new command system #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements a complete refactor of the command system using Brigadier and introduces several new features and enhancements. The main purpose is to modernize the command handling architecture with more robust argument parsing and validation.
Key changes include:
- Complete rewrite of command system using Brigadier for better argument validation and suggestions
- New command structure with
/bot config <name>
for viewing bot configurations - Enhanced command feedback with hover tooltips for additional information
- Breaking changes to bot removal timing format (now
1h2m3s
instead of separate hour/minute/second arguments)
Reviewed Changes
Copilot reviewed 98 out of 98 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
CraftTimerBotAction.java | Updated to use AbstractTimerBotAction instead of ServerTimerBotAction |
CraftBotAction.java | Changed from ServerBotAction to AbstractBotAction for consistency |
CraftBotManager.java | Updated action retrieval to use new AbstractBotAction hierarchy |
CraftBot.java | Modified to work with AbstractBotAction and improved remove method return handling |
UpdateCommand.java | Moved and rewritten using new Brigadier-based command structure |
ReloadCommand.java | Migrated to new command system with improved message handling |
CounterCommand.java | Complete rewrite using hierarchical command nodes and better state management |
ConfigCommand.java | New implementation with path/value argument validation and suggestions |
BlockUpdateCommand.java | Restructured with enable/disable subcommands and broadcast improvements |
Various bot command files | Comprehensive refactor to use new CustomArgumentNode and CommandContext system |
Bot action classes | Updated to use AbstractBotAction base class and new argument system |
Bot config classes | Refactored to use Brigadier ArgumentType and CommandContext for better type safety |
Comments suppressed due to low confidence (2)
leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java:1
- There's a double possessive apostrophe -
bot.getDisplayName()
already gets the possessive's
appended, then another's
is added, resulting in "BotName's's action list cleared".
package org.leavesmc.leaves.command.bot.subcommands;
leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java:1
- Same double possessive apostrophe issue as above - results in "BotName's's action list".
package org.leavesmc.leaves.command.bot.subcommands;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
leaves-server/src/main/java/org/leavesmc/leaves/command/leaves/subcommands/CounterCommand.java
Outdated
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/command/leaves/subcommands/CounterCommand.java
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/CreateCommand.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得没什么问题了
测试过 @s-yh-china 看过 就合吧(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
# Conflicts: # leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java
leaves-server/paper-patches/features/0003-Leaves-Server-Config-And-Command.patch
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该没什么问题了吧
@s-yh-china

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有一点小问题,剩下格式我改的差不多了
leaves-server/src/main/java/org/leavesmc/leaves/bot/agent/actions/ServerMountAction.java
Outdated
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/bot/agent/configs/SpawnPhantomConfig.java
Outdated
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/bot/agent/configs/TickTypeConfig.java
Outdated
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java
Show resolved
Hide resolved
leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/action/StopCommand.java
Show resolved
Hide resolved
暂时不应该合并 Update: 不做了 跑! |
This reverts commit b658777.
# Conflicts: # leaves-server/minecraft-patches/features/0002-Leaves-Server-Config.patch # leaves-server/minecraft-patches/features/0055-No-block-update-command.patch # leaves-server/minecraft-patches/features/0130-Prevent-loss-of-item-drops-due-to-update-suppression.patch # leaves-server/minecraft-patches/features/0136-Lithium-Sleeping-Block-Entity.patch # leaves-server/paper-patches/features/0003-Leaves-Server-Config.patch # leaves-server/src/main/java/org/leavesmc/leaves/bot/agent/actions/ServerLookAction.java # leaves-server/src/main/java/org/leavesmc/leaves/bot/agent/actions/ServerMountAction.java
resolves #712
使用准将重构了命令系统。
新功能:
/bot config <name>
查看某个 bot 的所有 config破坏性更改:
/bot remove
的定时移除参数格式,现在的格式如/bot remove test 1h2m3s
/leaves blockupdate
命令的使用方式,现在/leaves blockupdate
返回方块更新状态,/leaves blockupdate enable/disable
更改状态