GH-348 Post death command execution - #348
Conversation
Summary of ChangesHello @Jakubk15, 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 a significant new feature enabling server administrators to configure custom commands that execute automatically upon a player's death. This enhancement provides granular control over post-death events, allowing for different commands to be run by the console, the deceased player, or their killer, with options for deferred execution and combat-tagging conditions. Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The pull request introduces post-death command execution, a feature suggested by the community. This includes adding new configuration options for console, dead player, and killer commands, along with logic to defer command execution until respawn. The changes also update dependency versions and import statements. Overall, the implementation seems to address the requested feature effectively, but there are a few areas for improvement regarding code clarity and placeholder consistency.
| if (this.config.commands.onlyExecuteIfTagged) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I tested it and I wasn't able to produce any bugs, however I encourage other team members to try it nevertheless
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…t/death/DeathCommandController.java Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
…t/death/DeathCommandController.java Co-authored-by: DMK <81445555+imDMK@users.noreply.github.com>
…o feature/post-death-commands # Conflicts: # eternalcombat-plugin/src/main/java/com/eternalcode/combat/fight/death/DeathCommandController.java
…t/death/DeathCommandExecutor.java Co-authored-by: Piotr Zych <77621271+P1otrulla@users.noreply.github.com>
…t/death/DeathCommandExecutor.java Co-authored-by: Piotr Zych <77621271+P1otrulla@users.noreply.github.com>
…, clarify config comments
| return; | ||
| } | ||
|
|
||
| UUID playerUniqueId = player.getUniqueId(); |
There was a problem hiding this comment.
Why is the UUID called playerUniqueId in some places and playerUUID in others?
There was a problem hiding this comment.
These names were picked during coding, no particular reason
There was a problem hiding this comment.
Yeah, just pointing it out. My bad asking it as a question
vLuckyyy
left a comment
There was a problem hiding this comment.
The code works, but it feels overengineered for such a simple feature. My main concern is the dependency on event ordering and the state stored in killerNames and handledByUntag, since unusual flows or a player disconnecting could leave stale entries or cause commands to run twice.
ConcurrentHashMap also seems unnecessary here. I would simplify the flow, resolve the killer only once, clean up the stored state on quit, and reduce the number of classes, because Controller + Service + Executor + Resolver is a bit too much for this logic.
This feature adds post-death command execution, suggested on our Discord server.
Dev build: https://cdn.discordapp.com/attachments/1327365890458779729/1474338540971364373/EternalCombat_v2.5.1-SNAPSHOT.jar?ex=69997c44&is=69982ac4&hm=05087586545d195a2b4f410813a897a39c669e05723dccf480110452a16de914&