Repository navigation
fix: hide /tfmc pack auto|manual where the pack is required; link /tfmc drinks to the website - #55
Conversation
…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>
|
No actionable comments were generated in the recent review.
|
| 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:
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.
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.
Comment @coderabbitai help to get the list of available commands.
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>
|
@coderabbitai review |
✅ Action performed
|
Two
/tfmcsubcommands don't work on Main. This PR fixes both./tfmc pack auto|manualonly where it means something. On Main and Dev,resource-pack.require-on-join: truemakes the join gate send the pack to everyone, soauto/manualjust toggledtfmcresourcepack.enablefor 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 packstill reloads the pack everywhere. The hint moved frompack.loadingto a newpack.auto-hintkey./tfmc drinksnow links to the website. It used to run/drinkbuilderas the player, but DrinkBuilder v1.0.13 requiresdrinkbuilder.adminfor 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 readsdrinks.message, falling back to a built-in link when a livetfmc.ymldoesn'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