Skip to content

Conversation

@illyrius666
Copy link
Member

@illyrius666 illyrius666 commented Dec 20, 2025

Description

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • Other (please describe)

Signed-off-by: Illyrius <FitimQ@live.nl>
… player feedback

Signed-off-by: Illyrius <FitimQ@live.nl>
@illyrius666 illyrius666 self-assigned this Dec 20, 2025
Copilot AI review requested due to automatic review settings December 20, 2025 12:40
@github-actions github-actions bot changed the title Refactor/locator module/use waypoint api refactor/LocatorModule/useWaypointAPI Dec 20, 2025
@github-actions github-actions bot changed the base branch from main to dev December 20, 2025 12:40
@illyrius666 illyrius666 enabled auto-merge (squash) December 20, 2025 12:41
@illyrius666 illyrius666 disabled auto-merge December 20, 2025 12:41
@illyrius666 illyrius666 merged commit 37b7d39 into dev Dec 20, 2025
8 of 10 checks passed
@illyrius666 illyrius666 deleted the refactor/LocatorModule/useWaypointAPI branch December 20, 2025 12:41
Copy link
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

This PR refactors the LocatorModule to use the Bukkit waypoint API directly instead of dispatching commands, streamlining the implementation and improving code maintainability.

Key Changes:

  • Replaced command dispatching with direct waypoint API calls using Player.waypointColor property
  • Converted the locator function to an extension function on Player with simplified parameters
  • Added locator color change feature to the welcome message UI

Reviewed changes

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

File Description
LocatorModule.kt Refactored to use waypoint API directly, removed command suggestion logic, simplified color parameter handling, and converted locator method to a Player extension function
ChatModule.kt Added locator color change button to welcome message, updated sprite syntax from quoted namespace to unquoted format

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

Comment on lines 59 to +62
/**
* Modifies the colour of a player's waypoint based on the specified parameters.
* @param player The player whose waypoint is being modified.
* @param colour The optional named colour to apply to the waypoint.
* @param hex The optional hex colour to apply to the waypoint.
* @receiver Player The player whose waypoint colour is to be modified.
* @param color The optional named colour to apply to the waypoint.
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The documentation uses British spelling "colour" while the parameter name uses American spelling "color". For consistency, the documentation should match the parameter naming convention.

Copilot uses AI. Check for mistakes.
}
private fun Player.locator(color: TextColor? = null) {
waypointColor = color?.let { Color.fromRGB(it.value()) }
sendActionBar(Component.text("Locator color changed!", color))
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

When the color parameter is null (reset case), the action bar message "Locator color changed!" will be displayed without any color formatting. This might not provide clear feedback to the user about the reset action. Consider using a default color or a different message when color is null to make the reset action more explicit.

Suggested change
sendActionBar(Component.text("Locator color changed!", color))
val message =
if (color != null) {
Component.text("Locator color changed!", color)
} else {
Component.text("Locator color reset to default!", NamedTextColor.YELLOW)
}
sendActionBar(message)

Copilot uses AI. Check for mistakes.
"<image><gradient:#FFE259:#FFA751>⯈</gradient>",
"<image><gradient:#FFE259:#FFA751>⯈</gradient>",
"<image><gradient:#FFE259:#FFA751>⯈</gradient> <gradient:#CB2D3E:#EF473A>Welcome</gradient> <player> <click:suggest_command:'/nickname '><hover:show_text:'<gradient:#FFE259:#FFA751>Set your nickname!</gradient>'><white><sprite:\"minecraft:items\":item/name_tag></white></hover:show_text></click:suggest_command>",
"<image><gradient:#FFE259:#FFA751>⯈</gradient> <gradient:#CB2D3E:#EF473A>Welcome</gradient> <player> <click:suggest_command:'/nickname '><hover:show_text:'<gradient:#FFE259:#FFA751>Set your nickname!</gradient>'><white><sprite:items:item/name_tag></white></hover></click> <click:suggest_command:'/locator '><hover:show_text:'<gradient:#FFE259:#FFA751>Change your locator color!</gradient>'><white><sprite:items:item/compass_00></white></hover></click>",
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The closing tags use a shortened syntax (</hover> and </click>) which is inconsistent with the rest of the file. Other lines in the same config use the full tag syntax (e.g., </click:run_command>, </click:open_url> on lines 219-220). For consistency, consider using </hover:show_text>, </click:suggest_command> to match the existing pattern in this file.

Suggested change
"<image><gradient:#FFE259:#FFA751>⯈</gradient> <gradient:#CB2D3E:#EF473A>Welcome</gradient> <player> <click:suggest_command:'/nickname '><hover:show_text:'<gradient:#FFE259:#FFA751>Set your nickname!</gradient>'><white><sprite:items:item/name_tag></white></hover></click> <click:suggest_command:'/locator '><hover:show_text:'<gradient:#FFE259:#FFA751>Change your locator color!</gradient>'><white><sprite:items:item/compass_00></white></hover></click>",
"<image><gradient:#FFE259:#FFA751>⯈</gradient> <gradient:#CB2D3E:#EF473A>Welcome</gradient> <player> <click:suggest_command:'/nickname '><hover:show_text:'<gradient:#FFE259:#FFA751>Set your nickname!</gradient>'><white><sprite:items:item/name_tag></white></hover:show_text></click:suggest_command> <click:suggest_command:'/locator '><hover:show_text:'<gradient:#FFE259:#FFA751>Change your locator color!</gradient>'><white><sprite:items:item/compass_00></white></hover:show_text></click:suggest_command>",

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.

2 participants