Skip to content

Fix Hat command ignoring binding curse#54

Merged
TheBjoRedCraft merged 4 commits into
version/26.1from
fix/hat-command
May 28, 2026
Merged

Fix Hat command ignoring binding curse#54
TheBjoRedCraft merged 4 commits into
version/26.1from
fix/hat-command

Conversation

@twisti-dev
Copy link
Copy Markdown
Contributor

This pull request updates the hat command 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:

  • Added a check in HatCommand.kt to prevent players from changing their helmet if it has the Curse of Binding enchantment, unless they have the hat.command.bypass permission. This ensures players can't remove bound helmets unintentionally. [1] [2]
  • Implemented a private extension function isPreventArmorChange on ItemStack to detect the Curse of Binding enchantment using Paper's DataComponent API.

Permissions:

  • Added a new permission node hat.command.bypass to EssentialsPermissionRegistry for allowing certain players to bypass the Curse of Binding restriction.

Versioning:

  • Bumped the project version from 3.3.1 to 3.3.2 in gradle.properties.

Fixes #53

- 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
@twisti-dev twisti-dev self-assigned this May 28, 2026
Copilot AI review requested due to automatic review settings May 28, 2026 09:32
@twisti-dev twisti-dev linked an issue May 28, 2026 that may be closed by this pull request
@twisti-dev twisti-dev requested a review from TheBjoRedCraft May 28, 2026 09:33
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/main/kotlin/dev/slne/surf/essentials/command/HatCommand.kt
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /hat and /hat <player> paths, gated by a new hat.command.bypass permission.
  • Register the new HAT_COMMAND_BYPASS permission in EssentialsPermissionRegistry.
  • Bump version to 3.3.2, configure runServer { withSurfApiBukkit() } + Folia run task, and ignore the run/ 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.

Comment thread src/main/kotlin/dev/slne/surf/essentials/command/HatCommand.kt
Comment thread src/main/kotlin/dev/slne/surf/essentials/command/HatCommand.kt
@TheBjoRedCraft TheBjoRedCraft added this pull request to the merge queue May 28, 2026
Merged via the queue into version/26.1 with commit 49c7a4f May 28, 2026
1 check passed
@TheBjoRedCraft TheBjoRedCraft deleted the fix/hat-command branch May 28, 2026 10:57
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.

/hat kann Items mit Curse of Binding entfernen

3 participants