Additions#240
Draft
1robie wants to merge 26 commits intoMaxlego08:developfrom
Draft
Conversation
…size and attack range
… dependencies + use Reflexion to load ItemComponentLoader
…ties with updated component registration
…oss multiple classes
…Action && ItemPermissibleLoader
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 new API features, improvements to platform detection, and refactors around item stack handling and requirements. The most important changes are the addition of new annotations for versioning and platform targeting, introduction of platform detection utilities, and API adjustments to improve flexibility and clarity.
API Annotations and Platform Support
fr.maxlego08.menu.api.annotationsto mark classes for auto-listening (@AutoListener), component loading (@ComponentLoader), Paper-only (@PaperOnly), Spigot-only (@SpigotOnly), and version constraints (@SinceVersion,@UntilVersion). These will help with code organization and conditional logic based on platform or version. [1] [2] [3] [4] [5] [6]PlatformTypeenum infr.maxlego08.menu.api.utilsto detect and differentiate between Paper and Spigot servers at runtime, with convenience methods for platform checks.Reflection and Utility Improvements
ReflectionsCacheclass to cache and efficiently reuseReflectionsinstances for plugin class scanning, improving performance and reducing redundant reflection operations.getMap()accessor toTypedMapAccessorfor easier direct access to the underlying map.Item Stack and Inventory API Changes
AttackRangeComponentandMaxStackSizeComponentfrom concrete to abstract classes, and removed theirapplymethods, making them more extensible for future implementations. [1] [2]ZMenuItemStackto use the newMinecraftVersionclass for version checks instead ofNmsVersion, refactored stack size handling to only set the amount when not editing an existing context item, and improved version-specific meta handling. [1] [2] [3] [4] [5]Command and Requirement Enhancements
actions_requirements()method to theCommandinterface, allowing commands to specify requirements that must be met before executing actions.debugfield with getter/setter to theActionclass for easier debugging of requirements/actions. [1] [2]Inventory Management API
storeInventoryTemporaryOrClear(@NotNull Player)toInventoriesPlayerandclearInventory(@NonNull Player)toInventoryPlayerfor more granular inventory management options. [1] [2]Other minor changes include typo corrections and message description tweaks.