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.
...ombat-plugin/src/main/java/com/eternalcode/combat/config/implementation/CommandSettings.java
Outdated
Show resolved
Hide resolved
...ombat-plugin/src/main/java/com/eternalcode/combat/config/implementation/CommandSettings.java
Show resolved
Hide resolved
...alcombat-plugin/src/main/java/com/eternalcode/combat/fight/death/DeathCommandController.java
Outdated
Show resolved
Hide resolved
| 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
...alcombat-plugin/src/main/java/com/eternalcode/combat/fight/death/DeathCommandController.java
Outdated
Show resolved
Hide resolved
...alcombat-plugin/src/main/java/com/eternalcode/combat/fight/death/DeathCommandController.java
Show resolved
Hide resolved
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| const val PACKETEVENTS = "2.11.1" | ||
| const val WORLDGUARD = "7.0.15-beta-01" | ||
| const val LUCKPERMS = "5.5.17" | ||
| const val ETERNALCORE = "2.0.1-SNAPSHOT+12" |
There was a problem hiding this comment.
what? why snapshot not latest release??
There was a problem hiding this comment.
i thought snapshot = more features and more fixes. EternalCore snapshots are stable anyway
| @@ -0,0 +1,169 @@ | |||
| package com.eternalcode.combat.fight.death; | |||
There was a problem hiding this comment.
this class is in fight.death, why settings are in command settings?
There was a problem hiding this comment.
Because that class suits the purpose of the feature
There was a problem hiding this comment.
nah we have settings regarding death events I think it would be more suitable there
|
|
||
| @Comment({ | ||
| "# List of commands that will be executed from console after player death.", | ||
| "# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)." | ||
| }) | ||
| public List<String> consolePostDeathCommands = List.of( | ||
| "broadcast {player} has died in combat!" | ||
| ); | ||
|
|
||
| @Comment("# When this is set to true, the plugin will execute the console commands only after the dead player has respawned.") | ||
| public boolean deferConsoleAfterRespawn = false; | ||
|
|
||
| @Comment({ | ||
| "# List of commands that will be executed from the dead player's perspective after death.", | ||
| "# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)." | ||
| }) | ||
| public List<String> deadPostDeathCommands = List.of( | ||
| "say You have died in combat!" | ||
| ); | ||
|
|
||
| @Comment("# When this is set to true, the plugin will execute the commands above only after the dead player has respawned.") | ||
| public boolean deferDeadAfterRespawn = true; | ||
|
|
||
| @Comment({ | ||
| "# List of commands that will be executed from the killer's perspective after killing a player.", | ||
| "# Use {player} to represent the name of the player who was killed and {killer} for the killer's name (if applicable)." | ||
| }) | ||
| public List<String> killerPostDeathCommands = List.of( | ||
| "say You have killed {player} in combat!" | ||
| ); | ||
|
|
||
| @Comment("# When this is set to true, the plugin will only execute the post-death commands if the players were tagged") | ||
| public boolean onlyExecuteIfTagged = true; | ||
|
|
||
| @Comment("# The returned string when the killer is unknown") |
There was a problem hiding this comment.
maybe add options - suggestions for names to be easily distinguishable:
- onDeathInCombat
- console
- player
- onAnyDeath
- console
- player
- afterRespawn
- console
- player
- onUntag
- console
- player
| } | ||
| } | ||
|
|
||
| private void executeDeathCommands(Player deadPlayer) { |
There was a problem hiding this comment.
I feel like post mortem commands do not need to be stored in this method - when it's called in every listener.
code: this.pendingCommands.put(playerUUID, deferred);
| const val PACKETEVENTS = "2.11.1" | ||
| const val WORLDGUARD = "7.0.15-beta-01" | ||
| const val LUCKPERMS = "5.5.17" | ||
| const val ETERNALCORE = "2.0.1-SNAPSHOT+12" |
| "# List of commands that will be executed from console after player death.", | ||
| "# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)." | ||
| }) | ||
| public List<String> consolePostDeathCommands = List.of( |
There was a problem hiding this comment.
Maybe instead of adding few fields for do it in one list?
like:
killer:say GG
console:broadcast dupa
player:say dupaThere was a problem hiding this comment.
This is giving me multification vibes. I think I'm leaning more towards the multiple list approach that @CitralFlo suggested
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&