Skip to content

GH-1031 2.0 vanish implementation #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Conversation

P1otrulla
Copy link
Member

SIGMA VANISH SERVICE

@P1otrulla P1otrulla self-assigned this Jul 14, 2025
@P1otrulla P1otrulla requested a review from a team as a code owner July 14, 2025 16:23
Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update adds a vanish feature for players with new interfaces and service implementations to manage vanish states and metadata. It introduces commands to toggle vanish mode and permission constants for access control. Several event listeners handle player actions like chatting, item use, block breaking/placing, and interactions with containers when vanished. Effects such as god mode, glowing, and night vision are applied or removed on vanish state changes. The system also hides vanished players from tab completions, command suggestions, and player views on join and quit events, replacing previous vanish logic with a modular, event-driven design.


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.

Copy link

github-actions bot commented Jul 14, 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

@P1otrulla P1otrulla marked this pull request as draft July 14, 2025 16:23
@P1otrulla P1otrulla linked an issue Jul 14, 2025 that may be closed by this pull request
@P1otrulla P1otrulla changed the title 2.0 vanish implementation GH-1031 2.0 vanish implementation Jul 14, 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: 10

🧹 Nitpick comments (14)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (2)

12-12: Address the TODO comment

The TODO comment suggests incomplete implementation. Please clarify what if-check needs to be added or remove the comment if no longer needed.


23-23: Consider explicit access modifier

The event handler method lacks an explicit access modifier. Consider adding public or private to make the intent clear.

-    @EventHandler
-    void onChat(AsyncPlayerChatEvent event) {
+    @EventHandler
+    public void onChat(AsyncPlayerChatEvent event) {
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerQuitController.java (1)

22-22: Consider explicit access modifier

The event handler method lacks an explicit access modifier. Consider adding public or private for clarity.

-    @EventHandler
-    void onQuit(PlayerQuitEvent event) {
+    @EventHandler
+    public void onQuit(PlayerQuitEvent event) {
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleService.java (1)

8-17: Add JavaDoc documentation to clarify method contracts.

The interface methods lack documentation. Consider adding JavaDoc to specify behavior, especially for null parameter handling.

+/**
+ * Service for managing player visibility in vanish mode.
+ */
 public interface VanishInvisibleService {
 
+    /**
+     * Hides the specified player from other players.
+     * @param player the player to hide
+     */
     void hidePlayer(Player player);
 
+    /**
+     * Shows the specified player to other players.
+     * @param player the player to show
+     */
     void showPlayer(Player player);
 
+    /**
+     * Hides admin players from the specified player.
+     * @param player the player who should not see admins
+     */
     void hideAdminForPlayer(Player player);
 
+    /**
+     * Gets the set of currently vanished players.
+     * @return set of vanished player UUIDs
+     */
     Set<UUID> getVanishedPlayers();
 }
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishService.java (1)

7-19: Add JavaDoc documentation for better API clarity.

The interface methods need documentation to clarify their contracts and behavior.

+/**
+ * Service for managing player vanish state.
+ */
 public interface VanishService {
 
+    /**
+     * Enables vanish mode for the specified player.
+     * @param player the player to enable vanish for
+     */
     void enableVanish(Player player);
 
+    /**
+     * Disables vanish mode for the specified player.
+     * @param player the player to disable vanish for
+     */
     void disableVanish(Player player);
 
+    /**
+     * Checks if the specified player is vanished.
+     * @param player the player to check
+     * @return true if the player is vanished
+     */
     boolean isVanished(Player player);
 
+    /**
+     * Checks if the player with the specified UUID is vanished.
+     * @param uniqueId the UUID of the player to check
+     * @return true if the player is vanished
+     */
     boolean isVanished(UUID uniqueId);
 
+    /**
+     * Hides admin players from the specified player.
+     * @param player the player who should not see admins
+     */
     void hideAdminForPlayer(Player player);
 }
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1)

12-12: Address the TODO comment.

The TODO comment about "if-check" needs clarification. What specific check is missing?

Do you want me to help determine what check might be needed here, or should this TODO be resolved?

eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataService.java (1)

7-16: Add JavaDoc documentation for API clarity.

The interface methods need documentation to specify their behavior and contracts.

+/**
+ * Service for managing vanish metadata on players.
+ */
 public interface VanishMetaDataService {
 
+    /**
+     * Adds vanish metadata to the specified player.
+     * @param player the player to add metadata to
+     */
     void addMetadata(Player player);
 
+    /**
+     * Removes vanish metadata from the specified player.
+     * @param player the player to remove metadata from
+     */
     void removeMetadata(Player player);
 
+    /**
+     * Checks if the player with the specified UUID has vanish metadata.
+     * @param playerUniqueId the UUID of the player to check
+     * @return true if the player has vanish metadata
+     */
     boolean hasMetadata(UUID playerUniqueId);
 
+    /**
+     * Checks if the specified player has vanish metadata.
+     * @param player the player to check
+     * @return true if the player has vanish metadata
+     */
     boolean hasMetadata(Player player);
 }
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (1)

11-11: TODO comment needs attention

The TODO comment suggests adding an if-check, likely for configuration-based conditional logic. Consider implementing this or removing the comment if it's no longer needed.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (1)

13-13: TODO comment needs attention

Similar to other controllers, this TODO suggests adding conditional logic, possibly based on configuration settings.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (1)

12-12: Address the TODO comment.

The TODO comment about "if-check" needs clarification. What specific if-check needs to be implemented?

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/TabComplateController.java (1)

47-55: Consider optimizing the command filtering logic.

The nested loop checking all online players for each command could be slow with many players. Consider caching vanished player names.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GlowingController.java (1)

15-15: Consider adding configuration support.

The TODO comment suggests adding configuration support for conditional checks and color customization. This would improve flexibility.

Would you like me to help implement the configuration support mentioned in the TODO comment?

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/OpenSilentController.java (2)

61-61: Remove extra blank line.

There's an unnecessary blank line that should be removed for cleaner code.

-

22-22: Consider adding configuration support.

The TODO comment suggests adding configuration support. This would allow enabling/disabling this feature per server needs.

Would you like me to help implement the configuration support mentioned in the TODO comment?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d46fd55 and 58394c5.

📒 Files selected for processing (26)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleService.java (1 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataService.java (1 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/VanishService.java (1 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/AbstractVanishEvent.java (1 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/DisableVanishEvent.java (1 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/EnableVanishEvent.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/PlayerArgument.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishCommand.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishConfiguration.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleServiceImpl.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataServiceImpl.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishPermissionConstant.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishService.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishServiceImpl.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/BlockController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GlowingController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/OpenSilentController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerJoinController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerQuitController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/TabComplateController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/placeholder/PlaceholdersSetup.java (2 hunks)
💤 Files with no reviewable changes (1)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishService.java
🧰 Additional context used
🧠 Learnings (2)
eternalcore-core/src/main/java/com/eternalcode/core/placeholder/PlaceholdersSetup.java (1)
Learnt from: vLuckyyy
PR: EternalCodeTeam/EternalCore#865
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/essentials/item/give/GiveService.java:0-0
Timestamp: 2024-10-14T20:11:13.610Z
Learning: In the 'EternalCore' project, avoid using null in method signatures in Java code.
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishConfiguration.java (2)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#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.
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/privatechat/toggle/PrivateChatToggleCommand.java:1-1
Timestamp: 2025-01-30T19:49:57.192Z
Learning: In the EternalCore project's private chat toggle feature, PrivateChatToggleState.ON means messages are blocked, while OFF means messages are allowed.
🧬 Code Graph Analysis (10)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (4)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/DisableVanishEvent.java (1)
  • DisableVanishEvent (5-10)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/EnableVanishEvent.java (1)
  • EnableVanishEvent (5-10)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GlowingController.java (1)
  • Controller (16-53)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (1)
  • Controller (12-33)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishCommand.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishPermissionConstant.java (1)
  • VanishPermissionConstant (5-24)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerQuitController.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerJoinController.java (1)
  • Controller (13-50)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GlowingController.java (6)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/DisableVanishEvent.java (1)
  • DisableVanishEvent (5-10)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/EnableVanishEvent.java (1)
  • EnableVanishEvent (5-10)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (1)
  • Controller (10-27)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (1)
  • Controller (12-33)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (3)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/BlockController.java (1)
  • Controller (12-43)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (1)
  • Controller (13-46)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishServiceImpl.java (4)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/DisableVanishEvent.java (1)
  • DisableVanishEvent (5-10)
eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/EnableVanishEvent.java (1)
  • EnableVanishEvent (5-10)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleServiceImpl.java (1)
  • Service (14-68)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataServiceImpl.java (1)
  • Service (13-55)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/BlockController.java (3)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (1)
  • Controller (13-46)
eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/PlayerArgument.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishPermissionConstant.java (1)
  • VanishPermissionConstant (5-24)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/OpenSilentController.java (8)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerJoinController.java (1)
  • Controller (13-50)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/BlockController.java (1)
  • Controller (12-43)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1)
  • Controller (11-32)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (1)
  • Controller (10-27)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (1)
  • Controller (13-46)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (1)
  • Controller (12-33)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/TabComplateController.java (1)
  • Controller (16-57)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataServiceImpl.java (2)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleServiceImpl.java (1)
  • Service (14-68)
eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishServiceImpl.java (1)
  • Service (12-56)
🔇 Additional comments (42)
eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/PlayerArgument.java (1)

72-72: Clean permission constant refactoring

The update from VANISH_SEE_TABULATION_PERMISSION to VanishPermissionConstant.VANISH_SEE_PERMISSION improves naming consistency and aligns with the vanish feature overhaul.

eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/DisableVanishEvent.java (1)

5-10: Simple and clean event implementation

The event class correctly extends AbstractVanishEvent and follows standard event patterns. The implementation is appropriate for representing vanish disable events.

eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/EnableVanishEvent.java (1)

5-10: Consistent event design

The event class mirrors the DisableVanishEvent structure and correctly extends AbstractVanishEvent. Good symmetry in the event design.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ChatController.java (1)

24-31: Clean vanish chat blocking logic

The implementation correctly prevents vanished players from chatting by checking vanish status and canceling the event. The early return pattern keeps the code clean.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/PlayerQuitController.java (1)

25-29: Proper vanish cleanup on quit

The implementation correctly suppresses quit messages for vanished players and cleans up the vanish state. This prevents revealing vanished players through quit messages.

eternalcore-core/src/main/java/com/eternalcode/core/placeholder/PlaceholdersSetup.java (2)

21-21: Parameter type updated correctly for new architecture.

The change from VanishService to VanishMetaDataService aligns with the new vanish feature architecture.


25-25: Method call updated consistently with new service.

The change from vanishService.isVanished(onlinePlayer) to vanishMetaDataService.hasMetadata(onlinePlayer) is correct for the new metadata-based vanish system.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/FoodController.java (1)

22-31: Implementation follows established pattern correctly.

The food level change prevention logic is consistent with other vanish controllers and properly handles the event cancellation.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/BlockController.java (3)

12-20: Clean implementation following established patterns

The controller properly uses dependency injection and follows the same structure as other vanish controllers. Good use of the @controller annotation and constructor injection.


22-31: Block breaking prevention logic looks correct

The event handler properly checks vanish status before cancelling the event. The early return pattern keeps the code clean and readable.


33-42: Block placement prevention follows the same pattern

Consistent implementation with the break handler. Both methods follow the same logical flow which is good for maintainability.

eternalcore-api/src/main/java/com/eternalcode/core/feature/vanish/event/AbstractVanishEvent.java (1)

7-28: Proper Bukkit event implementation

The abstract event class correctly implements the HandlerList pattern and provides a clean foundation for vanish events. The static HandlerList and required methods follow Bukkit conventions perfectly.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GodModeController.java (1)

14-26: God mode toggle implementation is correct

The event handlers properly toggle player invulnerability based on vanish state. The logic is straightforward and matches the pattern used in other controllers.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishConfiguration.java (1)

5-20: Configuration structure looks functional

The boolean flags provide good coverage of vanish behaviors. The default values seem reasonable for typical vanish functionality.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/NightVisionController.java (2)

16-18: Good potion effect configuration

The night vision effect is properly configured with maximum duration and no visual indicators, which is perfect for a vanish feature.


20-32: Night vision toggle logic is correct

The event handlers properly apply and remove the night vision effect based on vanish state. The implementation follows the established pattern from other controllers.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/ItemController.java (2)

24-34: Item pickup logic looks good.

The event handling correctly prevents vanished players from picking up items.


36-45: Item drop logic looks good.

The event handling correctly prevents vanished players from dropping items.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishCommand.java (2)

22-32: Command logic looks good.

The vanish toggle logic for self is implemented correctly.


34-45: Command logic looks good.

The vanish toggle logic for other players is implemented correctly with proper permission checks.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/GlowingController.java (4)

19-25: Well-structured initialization.

The constructor properly injects dependencies and initializes the scoreboard reference. The static team name constant is a good practice.


27-33: Good event handling pattern.

The enable vanish event handler correctly adds the player to the team and sets glowing state. This follows the same pattern as other vanish controllers.


35-41: Good event handling pattern.

The disable vanish event handler correctly removes the player from the team and disables glowing. This properly reverses the enable operation.


43-52: Smart lazy team creation.

The borrowTeam method efficiently creates the team only when needed and reuses existing teams. The AQUA color provides good visibility.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishMetaDataServiceImpl.java (5)

16-24: Clean service initialization.

The constructor properly initializes dependencies and the metadata key constant is well-defined.


26-29: Proper metadata management.

The addMetadata method correctly uses FixedMetadataValue to set the vanish state. This integrates well with Bukkit's metadata system.


31-34: Proper metadata cleanup.

The removeMetadata method correctly removes the plugin-specific metadata key.


36-43: Safe offline player handling.

The UUID-based metadata check safely handles offline players by returning false. This prevents null pointer exceptions.


45-53: Robust metadata checking.

The metadata validation properly iterates through all metadata values and checks for boolean true. This handles edge cases where multiple metadata values might exist.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishServiceImpl.java (5)

15-24: Excellent dependency injection setup.

The constructor properly injects all required services and follows dependency injection best practices.


26-32: Well-orchestrated vanish enabling.

The enableVanish method properly coordinates invisibility, metadata, and event triggering in the correct order.


34-40: Well-orchestrated vanish disabling.

The disableVanish method properly reverses the vanish state by coordinating visibility, metadata, and events.


42-50: Clean delegation pattern.

Both isVanished methods properly delegate to the metadata service, maintaining consistent behavior across Player and UUID-based checks.


52-55: Proper delegation to specialized service.

The hideAdminForPlayer method correctly delegates to the invisible service, maintaining separation of concerns.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/controller/OpenSilentController.java (5)

25-30: Proper dependency injection.

The constructor correctly injects the VanishService dependency following the established pattern.


32-46: Good event filtering.

The interaction event handler properly filters for right-click block actions and vanished players only.


48-59: Smart container handling.

The code properly identifies container types and handles ender chests specially by using the player's own ender chest inventory.


66-72: Excellent silent viewing implementation.

The event cancellation and inventory cloning create a perfect silent viewing experience. The custom title clearly indicates vanish mode.


74-92: Comprehensive container support.

The helper methods properly handle all container types including shulker boxes using Tags. The pattern matching is clean and efficient.

eternalcore-core/src/main/java/com/eternalcode/core/feature/vanish/VanishInvisibleServiceImpl.java (3)

17-26: Clean service initialization.

The constructor properly initializes dependencies and the vanished players set. Good use of dependency injection.


51-62: Solid admin hiding logic.

The hideAdminForPlayer method correctly handles offline players and self-exclusion. The logic is sound and safe.


64-67: Proper encapsulation.

The getVanishedPlayers method correctly returns an unmodifiable view of the set, preventing external modification.

P1otrulla and others added 3 commits July 14, 2025 18:37
…nish/controller/TabComplateController.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…nish/controller/PlayerJoinController.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…nish/VanishInvisibleServiceImpl.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@P1otrulla
Copy link
Member Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Simple Vanish Feature.
1 participant