Repository navigation
Require a configurable permission to hatch pet eggs - #37
Merged
Merged
Conversation
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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.permissionsets 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 withhatch-permission, following the usual global → species → pet inheritance;falseor""lifts the requirement for that type. Any other value fails configuration loading, as invaliddefault-tricksalready 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.ymldocuments 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.falseoverride, and losing the permission before confirmation.🤖 Generated with Claude Code