Skip to content

Conversation

@Jakubk15
Copy link
Member

This pull request introduces a new "Elder Guardian" trolling feature, allowing players to show an Elder Guardian effect to others, either visibly or silently. It includes changes to implement the command, integrate it into the translation system, and add support for the feature in the container utilities.

New Feature: Elder Guardian Command

  • Added ElderGuardianCommand class to handle the new /elderguardian command, including support for a silent flag (-s) and permission checks (eternalcore.troll.elderguardian). The command uses AdditionalContainerPaper to trigger the Elder Guardian effect and sends notices to the player. (ElderGuardianCommand.java)

Translation System Updates

  • Added a new TrollSection interface to the Translation system, with methods for elder guardian notices (elderGuardianShown and elderGuardianShownSilently). (Translation.java) [1] [2]
  • Implemented the TrollSection in the English (ENTranslation.java) and Polish (PLTranslation.java) translation files, with appropriate messages for both languages. (ENTranslation.java, PLTranslation.java) [1] [2]

Container Utility Enhancements

  • Added ELDER_GUARDIAN and ELDER_GUARDIAN_SILENT containers to AdditionalContainerPaper, enabling the Elder Guardian effect with or without visibility. (AdditionalContainerPaper.java)

Minor Code Cleanups

  • Adjusted import orders in Translation.java and PLTranslation.java for consistency. (Translation.java, PLTranslation.java) [1] [2]

@Jakubk15 Jakubk15 requested a review from a team as a code owner July 21, 2025 09:15
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

Walkthrough

This update adds a new "troll" section to the translation system for Elder Guardian messages in English and Polish, including interfaces and message classes. A new command allows showing the Elder Guardian overlay to players, with an optional silent mode. The old AdditionalContainerPaper class was removed and replaced by a new PaperContainer enum that handles opening container UIs. Supporting classes for Paper server features and overlays were introduced. All container-related command classes were updated to use the new PaperContainer enum instead of the removed class.

Estimated code review effort

3 (~45 minutes)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba6305 and d363488.

📒 Files selected for processing (2)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Jul 21, 2025

📦 Development Build Ready

Warning

Do not use this build in production. It is for testing purposes only and may be unstable.

👉 Click here to download the JAR

@Jakubk15 Jakubk15 changed the title Add elder guardian command along with appropriate translations GH-997 Add elder guardian command along with appropriate translations Jul 21, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (1)

24-24: Check if this import is needed.

The EntityDamageEvent import appears unrelated to the elder guardian troll feature. Verify this import is actually needed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59e7245 and 3150a93.

📒 Files selected for processing (5)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/ElderGuardianCommand.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (4 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2 hunks)
  • eternalcore-paper/src/main/java/com/eternalcode/containers/AdditionalContainerPaper.java (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (1)

Learnt from: CitralFlo
PR: #896
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggleCommand.java:92-102
Timestamp: 2025-01-28T21:37:36.945Z
Learning: In the EternalCore plugin's private chat feature, PrivateChatToggleState.ON means message blocking is enabled (no messages will be received), while PrivateChatToggleState.OFF means messages are allowed.

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)

Learnt from: CitralFlo
PR: #896
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggleCommand.java:92-102
Timestamp: 2025-01-28T21:37:36.945Z
Learning: In the EternalCore plugin's private chat feature, PrivateChatToggleState.ON means message blocking is enabled (no messages will be received), while PrivateChatToggleState.OFF means messages are allowed.

🧬 Code Graph Analysis (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/ElderGuardianCommand.java (1)
eternalcore-paper/src/main/java/com/eternalcode/containers/AdditionalContainerPaper.java (1)
  • AdditionalContainerPaper (11-43)
🔇 Additional comments (8)
eternalcore-paper/src/main/java/com/eternalcode/containers/AdditionalContainerPaper.java (1)

20-21: LGTM! Clean container implementation.

The new elder guardian containers follow the established pattern and correctly use the boolean parameter to control silent mode.

eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (2)

194-197: Good interface design for the troll section.

The TrollSection interface is well-structured and follows the established patterns used by other message sections in the translation system.


254-254: Consistent method addition.

The troll() method follows the same pattern as other section accessors in the interface.

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1)

566-575: Well-implemented English translation section.

The ENTrollSection provides clear, properly formatted messages that follow the established styling patterns. Good use of placeholders and distinction between normal and silent modes.

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)

590-599: Good Polish translation implementation.

The PLTrollSection provides appropriate Polish translations while maintaining consistency with the English implementation. The distinction between normal and silent modes ("po cichu") is clear.

eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/ElderGuardianCommand.java (3)

16-22: Well-structured command definition.

Good use of annotations with proper permission setup and clear documentation. The command name and alias are intuitive.


24-29: Clean dependency injection setup.

Proper constructor injection pattern for the NoticeService dependency.


31-52: Solid command execution logic.

The implementation correctly handles both silent and normal modes, uses the appropriate containers, and provides clear feedback to the command sender with proper placeholders.

@Jakubk15
Copy link
Member Author

output2

Copy link
Member

@vLuckyyy vLuckyyy left a comment

Choose a reason for hiding this comment

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

The command is also incomplete regarding version support. The @Compatibility annotation (which I mentioned twice) is missing, which specifies the version range in which the command should be enabled. The methods Player#showElderGuardian and Player#showElderGuardian(boolean) are available since version 1.19.2.

Sources: https://jd.papermc.io/paper/1.19.2/org/bukkit/entity/Player.html#showElderGuardian(boolean)
https://jd.papermc.io/paper/1.18.2/

@Jakubk15 Jakubk15 requested a review from vLuckyyy July 21, 2025 15:35
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.

Nice!

I am wondering is there a better way to name the package instead of troll.
I know that in Essential it's fun like commands for fun.

Also consider moving catboy command to this package.

@Rollczi is /catboy a fun or troll command :P

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
eternalcore-paper/src/main/java/com/eternalcode/paper/PaperFeature.java (1)

11-11: Consider removing unused generic parameter.

The generic type T isn't used meaningfully in the class. You could simplify this to just PaperFeature without the generic.

-public abstract class PaperFeature<T> {
+public abstract class PaperFeature {
eternalcore-paper/src/main/java/com/eternalcode/paper/PaperContainer.java (1)

18-21: Simplify the PaperFeature instantiation.

You don't need the anonymous class since you're not adding any additional logic.

-        this.feature = new PaperFeature<>(action, name) {
-        };
+        this.feature = new PaperFeature<>(action, name);

Note: This will require making PaperFeature a concrete class instead of abstract, or creating a simple concrete implementation.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3150a93 and 46c509a.

📒 Files selected for processing (17)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/AnvilCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/CartographyTableCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/GrindstoneCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/LoomCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/SmithingTableCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/StonecutterCommand.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/ElderGuardianCommand.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/ENElderGuardianMessages.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/ElderGuardianMessages.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/PLElderGuardianMessages.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (4 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2 hunks)
  • eternalcore-paper/src/main/java/com/eternalcode/containers/AdditionalContainerPaper.java (0 hunks)
  • eternalcore-paper/src/main/java/com/eternalcode/paper/PaperContainer.java (1 hunks)
  • eternalcore-paper/src/main/java/com/eternalcode/paper/PaperFeature.java (1 hunks)
  • eternalcore-paper/src/main/java/com/eternalcode/paper/PaperOverlay.java (1 hunks)
💤 Files with no reviewable changes (1)
  • eternalcore-paper/src/main/java/com/eternalcode/containers/AdditionalContainerPaper.java
✅ Files skipped from review due to trivial changes (11)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/GrindstoneCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/StonecutterCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/LoomCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/CartographyTableCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/SmithingTableCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/AnvilCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/ElderGuardianMessages.java
  • eternalcore-paper/src/main/java/com/eternalcode/paper/PaperOverlay.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/PLElderGuardianMessages.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/messages/ENElderGuardianMessages.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
🧰 Additional context used
🧠 Learnings (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/ElderGuardianCommand.java (1)

Learnt from: vLuckyyy
PR: #865
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/essentials/item/give/GiveService.java:61-72
Timestamp: 2024-10-14T20:14:03.215Z
Learning: In the 'EternalCore' project, input validation for command parameters like amount is performed by the command library, so methods such as giveItems do not need to add additional validation for these parameters.

🪛 GitHub Actions: Java CI with Gradle
eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/ElderGuardianCommand.java

[error] 8-8: Compilation failed: package com.eternalcode.overlays does not exist. Import statement 'import com.eternalcode.overlays.AdditionalOverlayPaper;' cannot be resolved.

🔇 Additional comments (6)
eternalcore-core/src/main/java/com/eternalcode/core/feature/troll/elderguardian/ElderGuardianCommand.java (2)

17-27: Good command structure and dependency injection.

The command follows proper patterns with appropriate annotations, permission checks, and dependency injection.


29-49: Clean command execution logic with proper translations.

The execute method handles both silent and regular modes correctly, with proper translation integration and placeholder usage.

eternalcore-paper/src/main/java/com/eternalcode/paper/PaperFeature.java (2)

13-14: Good use of static environment detection.

Smart to detect the environment once and reuse it for all feature checks.


24-33: Excellent error handling and environment validation.

The method properly checks for Paper compatibility and provides clear feedback to both players and administrators when features aren't supported.

eternalcore-paper/src/main/java/com/eternalcode/paper/PaperContainer.java (2)

7-15: Well-organized enum with all major container types.

Good coverage of container types with descriptive names and proper lambda usage.


23-25: Clean delegation pattern.

Simple and effective delegation to the underlying PaperFeature.

@P1otrulla P1otrulla self-requested a review July 21, 2025 23:08
@P1otrulla P1otrulla self-requested a review July 21, 2025 23:20
Copy link
Member

@P1otrulla P1otrulla left a comment

Choose a reason for hiding this comment

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

Good job! 🙌

@Jakubk15
Copy link
Member Author

Nice!

I am wondering is there a better way to name the package instead of troll. I know that in Essential it's fun like commands for fun.

Also consider moving catboy command to this package.

@Rollczi is /catboy a fun or troll command :P

Will do in another PR probably

@Jakubk15 Jakubk15 self-assigned this Jul 23, 2025
@vLuckyyy vLuckyyy linked an issue Jul 23, 2025 that may be closed by this pull request
@vLuckyyy vLuckyyy merged commit 59ced4e into master Jul 23, 2025
3 checks passed
@vLuckyyy vLuckyyy deleted the add-elder-guardian-command branch July 23, 2025 16:43
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.

/elder-guardian

6 participants