Skip to content

fix: hide /tfmc pack auto|manual where the pack is required; link /tfmc drinks to the website - #55

Merged
XxFran10xX merged 2 commits into
mainfrom
remove-pack-auto
Oct 24, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
remove-pack-auto

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Two /tfmc subcommands don't work on Main. This PR fixes both.

  • /tfmc pack auto|manual only where it means something. On Main and Dev, resource-pack.require-on-join: true makes the join gate send the pack to everyone, so auto/manual just toggled tfmcresourcepack.enable for nothing. Tutorial has no join gate, and its ConditionalEvents rule (a_resourcepack.yml) reads that permission. So the two subcommands, and the "Use /tfmc pack auto" hint after /tfmc pack, are now registered only when the join gate is off. They disappear on Main and Dev and keep working on Tutorial. Plain /tfmc pack still reloads the pack everywhere. The hint moved from pack.loading to a new pack.auto-hint key.
  • /tfmc drinks now links to the website. It used to run /drinkbuilder as the player, but DrinkBuilder v1.0.13 requires drinkbuilder.admin for every use, so donors only saw a permission error. It now sends donors a link to the website's Drinks tab, where custom drinks are made. It reads drinks.message, falling back to a built-in link when a live tfmc.yml doesn't have that key yet, so no instance goes silent after the upgrade. Non-donors still get the denied message.

Deploying: no live config edit is required. Optional tidy-ups: Main's pack.loading "auto" line was already removed live on 2026-10-23. Dev's copy of that line now points at a command that's gone there, so it can be deleted on Dev. Tutorial keeps it.

Found in the wiki audit (TFMCWeb #305). fran asked for the dead command to be removed in game too.

Tests: TfmcCommandTest (33) covers the gated and ungated pack tree and the drinks fallback. mvn verify, including the JaCoCo line gate, passes locally.

🤖 Generated with Claude Code

…e website

/tfmc pack auto|manual only toggled tfmcresourcepack.enable, which nothing
reads: the required pack is sent to everyone on join. /tfmc drinks ran
/drinkbuilder as the player, which is admin-only, so it always failed.
It now sends donors the website Drinks tab link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b63c725c-ac20-4b76-aeb1-7daa58358b88
Commits

Reviewing files that changed from the base of the PR and between 0c47510 and 0996af7.

Files selected for processing: 8
  • src/main/java/net/tfminecraft/tfmccore/TFMCCore.java
  • src/main/java/net/tfminecraft/tfmccore/tfmc/BukkitTfmcActions.java
  • src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcActions.java
  • src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java
  • src/main/resources/tfmc.yml
  • src/test/java/net/tfminecraft/tfmccore/PluginLifecycleCoverageTest.java
  • src/test/java/net/tfminecraft/tfmccore/tfmc/BukkitTfmcActionsCoverageTest.java
  • 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
    • The /tfmc pack auto and /tfmc pack manual options are unavailable when players must accept the resource pack on joining. The /tfmc pack command remains available.
    • Eligible donors now receive a configurable message linking to the drinks website instead of having the drink builder run automatically. A default link is provided when no message is configured.

The change exposes required-pack state to the command layer, restricts pack options and hints when packs are required on join, and changes the donor drinks command to send configured or default website-link messages.

Changes: Required resource pack

Layer / File(s) Summary
Expose required-pack state
src/main/java/net/tfminecraft/tfmccore/TFMCCore.java, src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcActions.java, src/main/java/net/tfminecraft/tfmccore/tfmc/BukkitTfmcActions.java, src/test/java/net/tfminecraft/tfmccore/PluginLifecycleCoverageTest.java, src/test/java/net/tfminecraft/tfmccore/tfmc/BukkitTfmcActionsCoverageTest.java
packRequiredOnJoin() reports whether a pack is required on join. The action implementation delegates to the plugin. Tests check the state and delegation.
Gate pack options and hint
src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java, src/main/resources/tfmc.yml, src/test/java/net/tfminecraft/tfmccore/tfmc/TfmcCommandTest.java
When a pack is required on join, the command omits the auto and manual options and does not send the auto hint. The pack command remains available. The configuration documents when the hint appears, and tests cover required and non-required modes.

Drinks command message

Layer / File(s) Summary
Send the drinks link to donors
src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java, src/main/resources/tfmc.yml, src/test/java/net/tfminecraft/tfmccore/tfmc/TfmcCommandTest.java
After the donor permission check succeeds, the command sends configured message lines or a default website link. The configuration replaces the player command with a drinks message. Tests check the link and the missing-message fallback.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to 0996a

The pack-command and drinks changes appear ready to merge after normal checks; no confirmed issue remains.

- [ ] 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 24, 2026
Tutorial has no join gate and a ConditionalEvents rule that reads
tfmcresourcepack.enable, so auto/manual still matter there. They are now
registered (with the "/tfmc pack auto" hint) only when
resource-pack.require-on-join is off, and stay gone on Main and Dev.
/tfmc drinks falls back to a built-in website link when a live
tfmc.yml has no drinks.message yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX XxFran10xX changed the title fix: drop /tfmc pack auto|manual and link /tfmc drinks to the website fix: hide /tfmc pack auto|manual where the pack is required; link /tfmc drinks to the website Oct 24, 2026
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 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 b8e5f28 into main Oct 24, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the remove-pack-auto branch October 24, 2026 09:13
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