Skip to content

feat: add rename command and update version to 3.2.4-SNAPSHOT#45

Merged
Keviro merged 1 commit into
version/26.1from
feat/rename-command
Apr 26, 2026
Merged

feat: add rename command and update version to 3.2.4-SNAPSHOT#45
Keviro merged 1 commit into
version/26.1from
feat/rename-command

Conversation

@TheBjoRedCraft
Copy link
Copy Markdown
Member

No description provided.

@TheBjoRedCraft TheBjoRedCraft self-assigned this Apr 26, 2026
Copilot AI review requested due to automatic review settings April 26, 2026 18:32
@Keviro Keviro merged commit 9bb1b38 into version/26.1 Apr 26, 2026
2 checks passed
@Keviro Keviro deleted the feat/rename-command branch April 26, 2026 18:33
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

Adds a new /rename command for renaming the item in a player’s main hand, introduces corresponding permissions, and bumps the project version.

Changes:

  • Added /rename command with optional MiniMessage parsing gated by a separate permission.
  • Registered the new command in PaperCommandManager.
  • Added new permission nodes and bumped version to 3.2.4-SNAPSHOT.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/main/kotlin/dev/slne/surf/essentials/util/permission/EssentialsPermissionRegistry.kt Adds permission nodes for the rename command and MiniMessage usage.
src/main/kotlin/dev/slne/surf/essentials/command/RenameCommand.kt Implements the /rename command logic and permission checks.
src/main/kotlin/dev/slne/surf/essentials/PaperCommandManager.kt Registers the new rename command during command setup.
gradle.properties Updates the project version to 3.2.4-SNAPSHOT.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +28 to +35
val displayName =
if (player.hasPermission(EssentialsPermissionRegistry.RENAME_COMMAND_MINIMESSAGE)) miniMessage.deserialize(
content
) else Component.text(content)

item.editMeta {
it.displayName(displayName)
}
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

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

The item display name is set without explicitly disabling the default italic decoration. In this codebase, item display names/lore are consistently forced to non-italic (e.g., ItemEditCommand.kt uses decorationIfAbsent(TextDecoration.ITALIC, FALSE)), otherwise renamed items will appear italicized in-game. Apply the same decoration handling to displayName before calling it.displayName(...) (for both MiniMessage and plain text paths).

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +18
greedyStringArgument("content") {
playerExecutor { player, arguments ->
val item = player.inventory.itemInMainHand
val content: String by arguments
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

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

The command argument is named content, but other item renaming/editing commands in this project use more specific names like name (see ItemEditCommand.kt's greedyStringArgument("name")). Since this argument name typically shows up in generated command help/usage, consider renaming it to name for consistency and clarity.

Copilot uses AI. Check for mistakes.
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.

3 participants