Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and bug fixes across the codebase, focusing on type safety, null checks, and minor refactoring. The most significant change is the refactoring of the
itemModelproperty and related methods to useNamespacedKeyinstead ofString, improving type safety and consistency for item models. Additionally, the pull request adds extra null checks for player objects in event listeners, updates method contracts for better nullability annotations, and corrects minor typos and logic in utility classes.Type safety and API improvements:
Refactored
itemModelinMenuItemStack,MenuItemStackContext, andZMenuItemStackto useNamespacedKeyinstead ofString, updating related getter and setter methods and usages for improved type safety and clarity. (API/src/main/java/fr/maxlego08/menu/api/MenuItemStack.java[1] [2];API/src/main/java/fr/maxlego08/menu/api/context/MenuItemStackContext.java[3] [4];Common/src/main/java/fr/maxlego08/menu/ZMenuItemStack.java[5] [6] [7]Updated the
addItemmethods inBaseInventoryto provide more accurate nullability contracts, ensuring better static analysis and documentation. (API/src/main/java/fr/maxlego08/menu/api/engine/BaseInventory.javaAPI/src/main/java/fr/maxlego08/menu/api/engine/BaseInventory.javaL30-R42)Null checks and defensive programming:
Playerobjects in various packet event listeners to prevent potentialNullPointerExceptions during event handling. (Hooks/PacketEvents/src/main/java/fr/maxlego08/menu/hooks/packetevents/listener/PacketAnimationListener.java[1] [2] [3];Hooks/PacketEvents/src/main/java/fr/maxlego08/menu/hooks/packetevents/listener/PacketEventClickLimiterListener.java[4];Hooks/PacketEvents/src/main/java/fr/maxlego08/menu/hooks/packetevents/listener/PacketTitleListener.java[5]Bug fixes and logic improvements:
YamlParser, allowing for null results when a placeholder is an empty list and ensuring only valid strings are added to the result list. (Common/src/main/java/fr/maxlego08/menu/common/utils/yaml/YamlParser.java[1] [2]NoneLoaderto better handle class instantiation with plugin constructors and fallback to default constructors. (API/src/main/java/fr/maxlego08/menu/api/loader/NoneLoader.javaAPI/src/main/java/fr/maxlego08/menu/api/loader/NoneLoader.javaL24-L31)Minor fixes and refactoring:
Messageenum. (API/src/main/java/fr/maxlego08/menu/api/utils/Message.javaAPI/src/main/java/fr/maxlego08/menu/api/utils/Message.javaL111-R113)SpigotDyedColorItemComponentLoader). (src/main/java/fr/maxlego08/menu/ZComponentsManager.javasrc/main/java/fr/maxlego08/menu/ZComponentsManager.javaL54-R54)%player%as a valid argument in player argument validators. (src/main/java/fr/maxlego08/menu/command/validators/OnlinePlayerArgumentValidator.java[1];src/main/java/fr/maxlego08/menu/command/validators/PlayerArgumentValidator.java[2]ComponentMetaand other classes. (Hooks/Paper/src/main/java/fr/maxlego08/menu/hooks/ComponentMeta.java[1] [2];src/main/java/fr/maxlego08/menu/ZInventory.java[3] [4];src/main/java/fr/maxlego08/menu/inventory/VInventoryManager.java[5]