Skip to content

GH-355 Add additional placeholder for combatNotification#355

Draft
CitralFlo wants to merge 1 commit intomasterfrom
time-placeholder
Draft

GH-355 Add additional placeholder for combatNotification#355
CitralFlo wants to merge 1 commit intomasterfrom
time-placeholder

Conversation

@CitralFlo
Copy link
Member

@CitralFlo CitralFlo commented Mar 3, 2026

image image

Signed-off-by: Michał Wojtas <wojtas.michal90@gmail.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the combat notification system by introducing a new placeholder that displays the remaining combat time in raw seconds. This provides greater flexibility for server administrators to tailor combat messages to their specific needs, offering an alternative to the existing formatted time placeholder.

Highlights

  • New Placeholder for Combat Notifications: Introduced a new {SECONDS} placeholder for combat notifications, allowing players to see the remaining combat time as a raw numeric value in seconds.
  • Enhanced Customization: The addition of the {SECONDS} placeholder provides more flexibility for server administrators to customize combat messages, alongside the existing {TIME} placeholder which formats the duration with metric units.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/config/implementation/MessagesSettings.java
    • Updated configuration comments to document the newly added {SECONDS} placeholder for combat notifications.
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/fight/FightTask.java
    • Implemented the logic to provide the value for the {SECONDS} placeholder in combat notifications, converting the remaining duration to seconds.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new {SECONDS} placeholder for combat notifications, which is a useful addition for configuration flexibility. The implementation is mostly correct, but I've identified a potential inconsistency in how the new placeholder calculates time compared to the existing {TIME} placeholder. My feedback includes a specific code suggestion to align their behavior and prevent potential confusion for users.

.player(player.getUniqueId())
.notice(this.config.messagesSettings.combatNotification)
.placeholder("{TIME}", DurationUtil.format(remaining, this.config.messagesSettings.withoutMillis))
.placeholder("{SECONDS}", String.valueOf(remaining.toSeconds()))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The use of remaining.toSeconds() truncates the duration, which can be inconsistent with the {TIME} placeholder that appears to round up. For example, a remaining time of 19.9 seconds would result in {SECONDS} being "19" while {TIME} could be "20s". This can be confusing.

To ensure consistency, it's better to round up the seconds for the {SECONDS} placeholder as well.

Suggested change
.placeholder("{SECONDS}", String.valueOf(remaining.toSeconds()))
.placeholder("{SECONDS}", String.valueOf((remaining.toMillis() + 999) / 1000))

Copy link
Member Author

Choose a reason for hiding this comment

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

image The value stays consistent between each implementation. Using `withoutMillies: false` only gives visible change to the user

@CitralFlo CitralFlo changed the title Add additional placeholder for combatNotification GH-355 Add additional placeholder for combatNotification Mar 3, 2026
Copy link
Contributor

@imDMK imDMK left a comment

Choose a reason for hiding this comment

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

For me, this PR is not useful at the moment.

I think a better approach would be to introduce a customizable time formatting mechanism, similar to what I implemented in my project:
https://github.com/imDMK/AdvancedPlayTime/blob/main/playtime-core/src/main/java/com/github/imdmk/playtime/shared/time/DurationFormatStyle.java

This would allow players to change the time formatting style according to their needs.

@CitralFlo
Copy link
Member Author

For me, this PR is not useful at the moment.

I think a better approach would be to introduce a customizable time formatting mechanism, similar to what I implemented in my project: https://github.com/imDMK/AdvancedPlayTime/blob/main/playtime-core/src/main/java/com/github/imdmk/playtime/shared/time/DurationFormatStyle.java

This would allow players to change the time formatting style according to their needs.

Cool, would You like to implement it in EternalCombat?

@CitralFlo CitralFlo marked this pull request as draft March 3, 2026 14:48
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