Skip to content

feat: show ConditionalEvents /tfmc commands in the command tree - #52

Merged
XxFran10xX merged 2 commits into
mainfrom
feat/conditional-events-command-paths
Oct 17, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
feat/conditional-events-command-paths

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

TFMCCore owns the /tfmc Brigadier tree, so a /tfmc ... command that only ConditionalEvents handles shows as an unknown command (red, no tab completion) in the client. When the CE event doesn't cancel the command, Core also rejects it after CE ran ("Incorrect argument for command").

Add an opt-in conditional-events.commands list to TFMCCore/tfmc.yml. Each entry is a literal path after /tfmc (e.g. kit iron remove), optionally ending in <args> for free-form arguments (e.g. roll <args>). Core adds those paths to the tree with a no-op executor, so the client sees them and Core no longer errors. CE still runs the commands, conditions and cooldowns. Existing Core handlers and their permission checks stay as they are, and invalid paths are logged and skipped. The list is empty by default, so servers that don't set it (Main, Dev) are unchanged. The tree is built at startup, so list changes need a restart.

This replaces draft #36 (closed), rebased on current main. Changes since #36: tests updated for #49 (promote instead of helper promote), and a test for invalid paths to cover the warning branch under the 100% line-coverage gate.

Validation:

  • mvn -B --no-transfer-progress clean verify: 809 tests, 0 failures, 0 uncovered lines.
  • TFMCDev01 (character bot, temporary CE events and list): with 3.7.1, /tfmc calendar ran CE and then gave "Incorrect argument", and roll 20 +2 / masks clear errored. With this build, the client's command tree has calendar, kit iron remove, roll <args> and masks clear, ban stays hidden from a non-helper, all of those run without an error, and /tfmc map, /tfmc tips and unknown subcommands behave as before.

For TFMCTutorial01, which has about 70 CE-only /tfmc commands (kits, rolls, calendar, professions, class).

🤖 Generated with Claude Code

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 627968e5-232c-4fa1-8d69-f4ec63975837
📥 Commits

Reviewing files that changed from the base of the PR and between fd3491e and a5607c0.

📒 Files selected for processing: 3
  • src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java
  • src/main/resources/tfmc.yml
  • src/test/java/net/tfminecraft/tfmccore/tfmc/TfmcCommandTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added configurable /tfmc command paths for handling by ConditionalEvents.
    • Configured paths can include nested commands and accept free-form arguments. Existing command handlers and permission checks are preserved.
    • Invalid command paths are skipped, and configuration changes take effect after a restart.

The /tfmc command tree now includes valid paths from conditional-events.commands. Invalid paths are logged and skipped. Added endpoints use successful no-op execution, and tests cover command visibility and execution.

Changes: ConditionalEvents command paths

Layer / File(s) Summary
Configure and extend the command tree
src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java, src/main/resources/tfmc.yml, src/test/java/net/tfminecraft/tfmccore/tfmc/TfmcCommandTest.java
The configuration documents the supported path syntax and restart requirement. build() adds valid configured paths, skips invalid paths, and preserves requirements on existing endpoints. Tests cover visibility, execution and malformed paths.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to a5607

The configured command paths can proceed through normal checks; no identified issue currently blocks merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 17, 2026
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 5e9da20 into main Oct 17, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the feat/conditional-events-command-paths branch October 17, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant