Fix Hat command ignoring binding curse#54
Conversation
- include run/ directory to ignore build artifacts - ensure local development files are not tracked
…iction - introduce HAT_COMMAND_BYPASS permission to allow players to change helmets - prevent armor change for players without the bypass permission
- add withSurfApiBukkit() to runServer configuration in build.gradle.kts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f795d3c74b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Prevents /hat from swapping a helmet that has the Curse of Binding enchantment, unless the executor holds a new bypass permission. Adds the supporting permission node, bumps the project version, and tweaks the build script with run-server / Folia tasks.
Changes:
- Add Curse of Binding check (via Paper's
DataComponentTypes.ENCHANTMENTS) in both/hatand/hat <player>paths, gated by a newhat.command.bypasspermission. - Register the new
HAT_COMMAND_BYPASSpermission inEssentialsPermissionRegistry. - Bump version to
3.3.2, configurerunServer { withSurfApiBukkit() }+ Folia run task, and ignore therun/directory.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/kotlin/dev/slne/surf/essentials/command/HatCommand.kt | Adds binding-curse check and isPreventArmorChange() extension using Paper's DataComponent API. |
| src/main/kotlin/dev/slne/surf/essentials/util/permission/EssentialsPermissionRegistry.kt | Registers the new HAT_COMMAND_BYPASS permission node. |
| gradle.properties | Bumps version from 3.3.1 to 3.3.2. |
| build.gradle.kts | Adds runServer { withSurfApiBukkit() } and a Folia run task. |
| .gitignore | Ignores the local run/ server directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request updates the
hatcommand to prevent players from swapping their helmet if it has the Curse of Binding enchantment, unless they have a specific bypass permission. It also introduces a new permission for bypassing this restriction and bumps the project version.Hat command improvements:
HatCommand.ktto prevent players from changing their helmet if it has the Curse of Binding enchantment, unless they have thehat.command.bypasspermission. This ensures players can't remove bound helmets unintentionally. [1] [2]isPreventArmorChangeonItemStackto detect the Curse of Binding enchantment using Paper's DataComponent API.Permissions:
hat.command.bypasstoEssentialsPermissionRegistryfor allowing certain players to bypass the Curse of Binding restriction.Versioning:
3.3.1to3.3.2ingradle.properties.Fixes #53