Skip to content
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

Code improvements #31

Merged
merged 7 commits into from
Oct 7, 2024
Merged

Code improvements #31

merged 7 commits into from
Oct 7, 2024

Conversation

NonSwag
Copy link
Member

@NonSwag NonSwag commented Oct 7, 2024

change world load to init event to prevent no area found error
Add weather argument type for flags
Made area argument in /area info optional
don't serialize default flags

The @SuppressWarnings("PatternValidation") annotation was removed from the getName method as it is no longer needed. This change will help maintain cleaner and more readable code without affecting functionality.
Introduced EnumArgumentType class to support enum type argument parsing. Updated AreaFlagCommand to utilize EnumArgumentType for WeatherType enum, enhancing command flexibility.
Updated the FlagArgumentType constructor to apply the provided filter when retrieving flags from the registry. This ensures only the flags that match the filter criteria are considered, improving the flexibility and robustness of the flag processing logic.
Changing the event from WorldLoadEvent to WorldInitEvent ensures areas are loaded earlier in the world lifecycle. This prevents issues arising from accessing not fully initialized worlds in the ProtectPlugin.
@NonSwag NonSwag added the enhancement New feature or request label Oct 7, 2024
@NonSwag NonSwag self-assigned this Oct 7, 2024
Updated the `AreaInfoCommand` to support fetching area information based on command sender's location. Refactored the command execution logic to streamline processing of both explicit and implicit area queries.
Replaced the SLF4JLogger with ComponentLogger for logging warnings about duplicate areas. This enhances the consistency and integration of logging within the existing system.
The line initializing each flag to its default value during deserialization has been removed. This change streamlines the deserialization process and prevents redundant operations.
@NonSwag NonSwag linked an issue Oct 7, 2024 that may be closed by this pull request
@NonSwag NonSwag merged commit 6ecbe99 into master Oct 7, 2024
3 checks passed
@NonSwag NonSwag deleted the improvements branch October 7, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues on creating new world
1 participant