Skip to content

feat: port dev-only /tfmc tutorial, parrot and worldboss commands - #30

Merged
ryanbarlow97 merged 1 commit into
mainfrom
feat/tfmc-dev-content
Sep 28, 2026
Merged

ryanbarlow97 merged 1 commit into
mainfrom
feat/tfmc-dev-content

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #29. These were the last /tfmc subcommands still handled by ConditionalEvents, and they only existed on TFMCDev01. They're content still being built, so each new tfmc.yml section ships with enabled: false and stays out of the command tree until it's turned on. On Main nothing changes; dev enables all three.

Command Was Now
/tfmc tutorial <name> clear /tfmc <name> clear, 13 separate triggers One node that suggests the names in tutorials.list. It runs that tutorial's clear commands, copied verbatim, with a 10 s cooldown per tutorial. Nothing referenced the old form.
/tfmc parrot LibsDisguises parrot plus Essentials fly/flyspeed for 20 s, 5 min cooldown Same disguise command. Flight goes through the Bukkit API and the previous flight settings are saved.
/tfmc unparrot Broken: nested inside parrot so ConditionalEvents ignored it, undefined action groups, typo undisguiseplaye Undisguises and ends the flight early
/tfmc worldboss info ConditionalEvents messages Same text, in MiniMessage

Parrot fixes. The old trigger turned flight off after 20 s but never reset the fly speed, so every player who used it kept a speed of 0.1 afterwards. Now the previous flight settings are restored in each of these cases:

  • when the flight expires
  • on /tfmc unparrot
  • when the player leaves, because Bukkit saves flight state with the player
  • on plugin disable

If the player is left airborne, they get 5 s of slow falling. parrot.permissions is empty, which means everyone can use it, matching the trigger. The broken unparrot checked for Ascended, which suggests it may have been meant as a donor perk.

Carried over unchanged (worth checking). The fishing tutorial's clear still takes MMOItems FISHING_RODS FISHING_ROD, shears and paper. The tutorial actually hands out CustomFishing fishing_rod, iron_hook and fish_bait.

The tutorial "give items" lantern events and the world-boss ticket events stay in ConditionalEvents. They aren't commands.

Verification

  • mvn verify: 218 tests pass. The new tests cover:
    • hidden until enabled
    • tutorial clear, cooldown and unknown names
    • parrot disguise, flight, expiry and cooldown
    • unparrot and logging out ending the flight
    • worldboss info
  • TFMCDev01 runs this build with the tutorial clear events, parrot.yml and tfmc_bosshelp removed from ConditionalEvents. Dev now has no /tfmc triggers left. It enabled with no warnings, the new subcommands parse from the console, and tcore reload tfmc works. Nobody was online, so I couldn't test parrot flight in game.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added configurable commands to clear selected tutorials, with cooldowns and confirmation messages.
    • Added a temporary parrot disguise mode with timed flight, configurable access and cooldowns, and restoration of prior flight settings when it ends or the player leaves.
    • Added configurable world-boss information.
    • These features are disabled by default and can be enabled in the plugin configuration.

These were the last /tfmc subcommands still handled by ConditionalEvents
triggers on TFMCDev01. They are content under construction, so each
section in tfmc.yml ships disabled and stays hidden from the command
tree until enabled.

- /tfmc tutorial <name> clear runs the tutorial's clear commands with a
  10 s cooldown (was /tfmc <name> clear; nothing referenced it)
- /tfmc parrot disguises the player and lets them fly briefly; the old
  trigger left their fly speed at 0.1 for good. Flight settings are
  now restored when it expires, on /tfmc unparrot (which never worked)
  and when the player leaves, with slow falling if they are airborne
- /tfmc worldboss info shows the world-boss explainer

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: 1a72fc06-7b1d-447e-99c1-1aee66354c9b

📥 Commits

Reviewing files that changed from the base of the PR and between 97e0381 and a0f9da8.

📒 Files selected for processing (7)
  • 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/java/net/tfminecraft/tfmccore/tfmc/TfmcConfig.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 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The pull request adds configurable tutorial clearing and world-boss information commands. It also adds timed parrot flight, restores prior flight settings when sessions end, and cleans up sessions on player quit or plugin shutdown.

Changes

Development commands

Layer / File(s) Summary
Command configuration and tutorial actions
src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcConfig.java, src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java, src/main/resources/tfmc.yml
Configuration helpers and command gates support tutorial clearing and world-boss information. Tutorial names are matched without case sensitivity, and clearing uses a configured cooldown.

Timed parrot flight

Layer / File(s) Summary
Flight actions and session lifecycle
src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcActions.java, src/main/java/net/tfminecraft/tfmccore/tfmc/BukkitTfmcActions.java, src/main/java/net/tfminecraft/tfmccore/tfmc/TfmcCommand.java, src/main/java/net/tfminecraft/tfmccore/TFMCCore.java, src/main/resources/tfmc.yml, src/test/java/net/tfminecraft/tfmccore/tfmc/TfmcCommandTest.java
Parrot sessions save prior flight settings and schedule expiry. Ending a session cancels expiry and restores those settings. Player quit and plugin shutdown also trigger cleanup. The tests cover command behavior, flight timing, restoration, and early cleanup.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Player
  participant TfmcCommand
  participant TfmcActions
  participant BukkitTfmcActions
  participant BukkitScheduler
  Player->>TfmcCommand: Request parrot flight
  TfmcCommand->>TfmcActions: startFlight(player, speed)
  TfmcActions->>BukkitTfmcActions: Start flight and save prior settings
  BukkitTfmcActions-->>TfmcCommand: Return FlightState
  TfmcCommand->>TfmcActions: later(ticks, expiry task)
  TfmcActions->>BukkitTfmcActions: Schedule delayed task
  BukkitTfmcActions->>BukkitScheduler: Schedule expiry
  BukkitScheduler->>TfmcCommand: Run expiry task
  TfmcCommand->>TfmcActions: endFlight(player, previous)
Loading

Merge Risk: ⚪ Minimal · up to a0f9d

No identified issue needs correction before merge. The tutorial cooldown and automatic parrot-flight expiry behave as intended.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to a0f9d

The new commands are disabled by default, and their normal permission and cleanup paths are bounded. On a server that enables parrot flight, however, a failed start or cleanup could leave a player’s temporary flight settings in place. The effective server configuration and failure behavior have not been verified.

Retained concerns

  • Medium · security · inferred: Parrot flight can lose its cleanup owner if scheduling or cleanup fails after player flight is changed. The quit and shutdown handlers then cannot reliably restore that session; an exception in shutdown cleanup can also prevent subsequent players from being restored.
Security review details

Security Blast Radius

  • inferred — When enabled, the flight feature is available to all players under the supplied permission list, but session state and the identified failure outcome are per player. The supplied configuration leaves it disabled.

Security Findings and Attack Paths

  • inferred — If scheduling fails after flight is enabled, no session is recorded for quit or shutdown to restore. If cleanup throws after removing a session, restoration is likewise skipped. Neither failure has been established as occurring in production.

Trust Boundaries and Controls

  • observed — The tutorial’s console-command boundary uses configured command text selected by an exact configured-key match, rather than treating player input as a command template. Parrot’s enabled and permission predicates are checked at its command node.

Resilience and Maintainability Implications

  • observed — The changed tests exercise sequential expiry, repeated use, unparrot, and quit cleanup, but do not demonstrate restoration after failed scheduling or failed cleanup actions.

Hardening Proposals

  • proposed — Make session ownership and flight activation a recoverable transition, and restore flight in a guaranteed cleanup path even if cancellation or undisguise fails. Exercise those failure paths before enabling the feature.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: porting the dev-only /tfmc tutorial, parrot, and worldboss commands.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 18.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit taps the parrot’s flight command.
Saved wings and speed are tucked away.
A timer marks the flight’s last tick.
The player lands; old settings return.
“Hooray,” says Rabbit, “all is tidy!”

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

@ryanbarlow97
ryanbarlow97 merged commit 4087608 into main Sep 28, 2026
2 checks passed
@ryanbarlow97
ryanbarlow97 deleted the feat/tfmc-dev-content branch September 28, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant