Skip to content

Conversation

P1otrulla
Copy link
Member

@P1otrulla P1otrulla commented Aug 11, 2025

Note: the location of the Permission annotation was changed specifically because in the current configuration /combat reload can be used by anyone on the server???

Introduces PlaceholderSettings to allow customization of placeholder output, specifically for isInCombat_formatted. Adds new placeholders isInCombat and isInCombat_formatted to FightTagPlaceholder, updates BridgeService and PluginConfig to support the new settings, and adjusts command permission annotation placement. Also updates build scripts and dependencies.

Please describe the changes made by this PR and why they need to be merged:

Introduces PlaceholderSettings to allow customization of placeholder output, specifically for isInCombat_formatted. Adds new placeholders isInCombat and isInCombat_formatted to FightTagPlaceholder, updates BridgeService and PluginConfig to support the new settings, and adjusts command permission annotation placement. Also updates build scripts and dependencies.
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.

Summary of Changes

Hello @P1otrulla, 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 introduces significant enhancements to the plugin's placeholder system, allowing for greater customization and flexibility. It adds new placeholders to display combat status and makes their output configurable through dedicated settings. Additionally, it refines command permission handling and updates build configurations to align with recent changes.

Highlights

  • Configurable Placeholder Settings: Introduced a new PlaceholderSettings class that allows for the customization of strings returned by certain placeholders, specifically isInCombat_formatted.
  • New Combat Status Placeholders: Added two new placeholders: isInCombat, which returns a boolean string ("true" or "false") indicating combat status, and isInCombat_formatted, which returns user-defined strings based on the combat state.
  • Configuration Integration for Placeholders: Updated the BridgeService to pass the new PlaceholderSettings to the FightTagPlaceholder and integrated these settings into the PluginConfig to enable user configuration.
  • Refined Command Permissions: The @Permission annotation for the EternalCombatReloadCommand was moved from the class level to the specific execute method, providing more precise permission control for the reload command.
  • Build Script Updates: The project version was updated to 2.2.1-SNAPSHOT, and the Minecraft version for the runServer task was adjusted from 1.21.4 to 1.21 in the build scripts.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 configurable placeholders for combat status, which is a great addition for server owners to customize their messages. The changes are well-structured, touching upon configuration, placeholder logic, and services. The refactoring of the command permission annotation from class-level to method-level is a good improvement for granularity. I have a couple of suggestions to improve the code further, mainly regarding an unused import and optimizing the new placeholder logic for better performance and maintainability.

@CitralFlo
Copy link
Member

new.placeholder.mp4

@CitralFlo CitralFlo removed their request for review August 11, 2025 19:54
@P1otrulla P1otrulla requested a review from Rollczi August 11, 2025 20:09
@P1otrulla P1otrulla changed the title Add configurable placeholder settings and new placeholders GH-253 Add configurable placeholder settings and new placeholders Aug 11, 2025
@P1otrulla P1otrulla requested a review from Rollczi August 22, 2025 15:30
@P1otrulla
Copy link
Member Author

/gemini review

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 configurable settings for placeholders and adds new placeholders, which is a great enhancement. The refactoring of FightTagPlaceholder to use a switch expression improves readability, and the permission fix for the reload command is an important correction. I've provided a couple of suggestions to further improve the placeholder implementation: one to align with PlaceholderAPI's standard behavior for unknown placeholders, and another to simplify one of the helper methods for better conciseness.

@P1otrulla
Copy link
Member Author

Fully tested it's working

.orElse("");
}
private String handleIsInCombat(OfflinePlayer player) {
return String.valueOf(this.isPlayerInCombat(player));
Copy link
Member

Choose a reason for hiding this comment

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

Use Boolean#toString

Suggested change
return String.valueOf(this.isPlayerInCombat(player));
return this.isPlayerInCombat(player).toString();

Comment on lines +78 to +79
downloadPlugins.url("https://www.spigotmc.org/resources/packetevents-api.80279/download?version=599651")
downloadPlugins.url("https://www.spigotmc.org/resources/placeholderapi.6245/download?version=541946")
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you can download plugins from SpigotMC? Don't they have some sort of anti-CDN downloader?

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.

4 participants