Skip to content

Conversation

@Pawelusze
Copy link

@Pawelusze Pawelusze commented Dec 14, 2025

I've added new options to Pearl and Trident that reset the timer when the player uses them.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Pawelusze, 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 significantly expands the combat system by introducing new, highly configurable mechanics for both Ender Pearls and Tridents. The core addition is the ability to reset a player's combat timer when they throw an Ender Pearl or use a Trident, providing more dynamic and strategic combat scenarios. Furthermore, it establishes a comprehensive set of combat-specific settings for Tridents, including options to restrict their use during combat and implement cooldowns, aligning them with existing pearl-related features.

Highlights

  • Trident Combat Mechanics: Introduced new combat-related features for tridents, including options to disable throwing during combat, apply cooldowns, and reset the combat timer upon use.
  • Pearl Combat Timer Reset: Added a new configurable option to reset a player's combat timer when they throw an Ender Pearl, enhancing combat engagement.
  • Enhanced Configurability: All new trident and pearl timer reset functionalities are fully configurable via the PluginConfig, allowing server administrators to tailor combat behavior.
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 new features for handling tridents in combat and adds an option to reset the combat timer upon using ender pearls or tridents. The implementation is largely correct, but I've identified a critical issue: the fightTridentService is used without being initialized, which will lead to a NullPointerException. I've also found several copy-paste errors in the new trident-related classes, including incorrect naming and comments that refer to 'pearls' instead of 'tridents'. My review includes suggestions to fix these issues to ensure the code is correct and maintainable. Additionally, I've pointed out an unused import that should be removed.

@Pawelusze Pawelusze changed the title I've added new options to Pearl and Trident that reset the timer when… GH-303 New feature to trident and pearls Dec 14, 2025
@Pawelusze Pawelusze changed the title GH-303 New feature to trident and pearls GH-303 New feature for trident and pearls Dec 14, 2025
@Pawelusze Pawelusze changed the title GH-303 New feature for trident and pearls GH-303 New features for Trident and Pearls Dec 14, 2025
@Jakubk15 Jakubk15 linked an issue Dec 14, 2025 that may be closed by this pull request
@Jakubk15 Jakubk15 changed the title GH-303 New features for Trident and Pearls GH-266 New features for Trident and Pearls Dec 14, 2025
Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

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

Resolve reviews and the Riptide issue mentioned by Jakubek

Copy link
Contributor

@igoyek igoyek left a comment

Choose a reason for hiding this comment

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

Follow friend's instructions :)

@Jakubk15 Jakubk15 force-pushed the feature/add-reset-timer branch from f4bdbb7 to e48a01f Compare December 29, 2025 19:38
@Jakubk15
Copy link
Member

Add right-click check to inflict the cooldown only on throw, not on melee attack

@CitralFlo
Copy link
Member

Also closes: #296

@Pawelusze Pawelusze force-pushed the feature/add-reset-timer branch from 36cf3cb to ab4e804 Compare February 2, 2026 19:47
@Pawelusze Pawelusze requested a review from CitralFlo February 2, 2026 19:57
return;
}

if (this.pluginConfig.trident.tridentRiptideDisabledDuringCombat) {
Copy link
Member

Choose a reason for hiding this comment

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

this could be higher before isInCombat - when the option is disable we dont need to check if the players is in combat

Copy link
Member

@Jakubk15 Jakubk15 Feb 8, 2026

Choose a reason for hiding this comment

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

Exactly, so why is this marked as resolved? #303 (comment)

@Pawelusze Pawelusze requested a review from CitralFlo February 4, 2026 15:51
@Pawelusze Pawelusze force-pushed the feature/add-reset-timer branch from e41590e to 68fb2ef Compare February 5, 2026 21:17
Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

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

Would be cool if @Rollczi could take a look at reloading the plugin - cache settings thing. Ref needed but using supplier in my case did not work.

@CitralFlo CitralFlo requested review from Jakubk15 and igoyek and removed request for igoyek February 7, 2026 23:44
@CitralFlo
Copy link
Member

@Jakubk15 re-review requested due to massive changes

Copy link
Member

@Jakubk15 Jakubk15 left a comment

Choose a reason for hiding this comment

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

https://streamable.com/prq6pq Trident cooldown still applies when leaving combat. Up to you if you want to clear it after combat tag has passed.

import java.time.Instant;
import java.util.function.Supplier;

public class Delay<T> {
Copy link
Member

Choose a reason for hiding this comment

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

How about we wait until GH-76/EternalCodeCommons is merged first?

return;
}

if (this.pluginConfig.trident.tridentRiptideDisabledDuringCombat) {
Copy link
Member

@Jakubk15 Jakubk15 Feb 8, 2026

Choose a reason for hiding this comment

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

Exactly, so why is this marked as resolved? #303 (comment)

Comment on lines +50 to +60
if (this.tridentService.hasDelay(uniqueId)) {
Duration remainingDelay = this.tridentService.getRemainingDelay(uniqueId);

this.noticeService.create()
.player(uniqueId)
.notice(this.pluginConfig.trident.tridentRiptideOnCooldown)
.placeholder("{TIME}", DurationUtil.format(remainingDelay))
.send();

return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this code reachable? Is it possible to somehow bypass the vanilla delay? Do cheat clients have that feature? Looks like dead code to me, but feel free to reproduce.

Comment on lines +38 to +40
if (this.pluginConfig.trident.tridentRiptideDelay.isZero()) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Move this to the top perhaps?

public boolean riptideResetsTimerEnabled = false;

@Comment({
"# Should riptide enchantment be on cooldown?",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"# Should riptide enchantment be on cooldown?",
"# Should riptide enchantment be on cooldown during combat?",

Comment on lines +25 to +26
})
public Duration tridentRiptideDelay = Duration.ofSeconds(10);
Copy link
Member

Choose a reason for hiding this comment

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

what if the value is negative? Specify this also in the comment

Comment on lines +33 to +40
@Comment({
"# Message sent to the player when riptide is on cooldown",
"# Available placeholder: {TIME} - remaining time left to use riptide again"
})
public Notice tridentRiptideOnCooldown = BukkitNotice.builder()
.chat("<red>You must wait {TIME} before next riptide!")
.build();
}
Copy link
Member

Choose a reason for hiding this comment

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

potential dead code


if (event.getFrom().distanceSquared(event.getTo()) == 0) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we maybe improve this check?

2026-02-08.11-51-08.mp4

Copy link
Member

Choose a reason for hiding this comment

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

I saw it once! And couldn't reproduce it, do You have any tip how?

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.

Ender Pearl & Trident Combat Reset

5 participants