Skip to content

Require a configurable permission to hatch pet eggs - #37

Merged
Nowkoo merged 1 commit into
mainfrom
fix/hatch-permission
Oct 10, 2026
Merged

Nowkoo merged 1 commit into
mainfrom
fix/hatch-permission

Conversation

@Nowkoo

@Nowkoo Nowkoo commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Egg recipes are limited to specific roles, but CompanionPets never checked a permission when an egg was used. A player who received an egg by trade could hatch it without the role required to craft it.

hatching.permission sets a global permission node required to hatch any egg; by default nothing is required, so existing setups behave as before. Species and pets can override it with hatch-permission, following the usual global → species → pet inheritance; false or "" lifts the requirement for that type. Any other value fails configuration loading, as invalid default-tricks already do.

The permission is checked when hatching starts and again at the final confirmation, so revoking it or reloading the configuration during the chat dialogue cannot hatch a pet. A refused player keeps the egg, and the vanilla spawn egg behaviour remains suppressed. The bundled config.yml documents both options; its examples stay commented, so the shipped configuration remains unrestricted.

Validation:

  • mvn clean verify: 999 tests, no failures or errors, three opt-in tests skipped; all coverage checks met.
  • New tests cover inheritance and validation, refusal without the permission, a pet-level false override, and losing the permission before confirmation.
  • Apart from this change, the build's classes are byte-identical to the jar previously deployed on TF Main and TF Dev. The new jar and per-pet permissions copied from each server's Animal Station recipes are installed on both, and take effect at their next restart; neither server was restarted or reloaded.

🤖 Generated with Claude Code

Egg recipes are restricted to certain roles, but anyone holding a traded
egg could still hatch it. hatching.permission sets a global requirement;
species and pets override it with hatch-permission (false or "" clears it).
The permission is checked when hatching starts and again at confirmation,
and a refused player keeps the egg.

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

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4dc9c75-0bb3-4934-994e-4304b914b9f4

  • 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.

@Nowkoo
Nowkoo merged commit 892053d into main Oct 10, 2026
2 checks passed
@Nowkoo
Nowkoo deleted the fix/hatch-permission branch October 10, 2026 00:12
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