Skip to content

Conversation

igoyek
Copy link
Contributor

@igoyek igoyek commented Aug 17, 2025

image

For now, this is how it works. I'll add a few minor tweaks, but please share your feedback and suggestions :)

I think splitting the system into two separate commands would be a better approach than creating two subcommands, /freeze freeze and /freeze unfreeze.

Also, instead of following the class @vLuckyyy sent, I replaced the CommandSender class with Player to make it easier to send personalized messages for the performer and target.

Introduces FreezeCommand and UnFreezeCommand for freezing and unfreezing players, including support for self and other actions. Adds localized freeze messages in English and Polish, and integrates freeze message sections into the translation system.

Took 47 minutes
@igoyek igoyek self-assigned this Aug 17, 2025
@igoyek igoyek added the 🆕 feature New feature or request label Aug 17, 2025
@igoyek igoyek requested a review from a team as a code owner August 17, 2025 13:30
@igoyek igoyek added the 🚀 EternalCore 2.0 Major rework and refactor for the upcoming EternalCore 2.0 release label Aug 17, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in EternalCore Aug 17, 2025
@igoyek igoyek linked an issue Aug 17, 2025 that may be closed by this pull request
@igoyek igoyek changed the title Add freeze and unfreeze player commands GH-993 Add freeze and unfreeze player commands Aug 17, 2025
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 freeze and unfreeze commands, which is a great addition. The implementation is solid, with separate logic for self-action and targeting other players, including permission checks and localized messages.

My review includes a few suggestions to improve maintainability and adhere to standard Java conventions. Specifically, I've pointed out areas with duplicated code in both FreezeCommand and UnFreezeCommand that could be refactored into helper methods. I've also noted a class naming convention issue in UnFreezeCommand. Addressing these points will make the code cleaner and easier to manage in the future.

Introduced FreezeService interface and its implementation to centralize freeze/unfreeze logic. Added PlayerFreezeEvent and PlayerUnfreezeEvent for event handling. Refactored FreezeCommand and UnfreezeCommand to use FreezeServiceImpl, improving code modularity and event support. Renamed UnFreezeCommand to UnfreezeCommand for consistency.

Took 33 minutes
Updated UnfreezeCommand to use freezeServiceImpl.unfreezePlayer instead of freezePlayer with Duration.ZERO for unfreezing logic. This improves code clarity and better reflects the intended operation.

Took 2 minutes
@igoyek igoyek requested a review from Jakubk15 August 17, 2025 16:30
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.

Looking gucci

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.

image

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.

Resolve conflicts

igoyek and others added 2 commits August 21, 2025 08:10
Deleted FreezeService, FreezeServiceImpl, and related PlayerFreezeEvent and PlayerUnfreezeEvent classes. Refactored FreezeCommand and UnfreezeCommand to directly manipulate player freeze ticks, simplifying the freeze feature and removing event-based architecture.

Took 6 minutes
@igoyek igoyek requested a review from vLuckyyy August 21, 2025 06:11
@P1otrulla P1otrulla self-requested a review August 22, 2025 00:59
@P1otrulla P1otrulla merged commit d1e3bcb into master Aug 22, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in EternalCore Aug 22, 2025
@P1otrulla P1otrulla deleted the freeze-command branch August 22, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 EternalCore 2.0 Major rework and refactor for the upcoming EternalCore 2.0 release 🆕 feature New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

/freeze <player>
5 participants