Skip to content

Additions#240

Draft
1robie wants to merge 26 commits intoMaxlego08:developfrom
1robie:developement
Draft

Additions#240
1robie wants to merge 26 commits intoMaxlego08:developfrom
1robie:developement

Conversation

@1robie
Copy link
Copy Markdown
Collaborator

@1robie 1robie commented May 8, 2026

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

  • Added new annotations in fr.maxlego08.menu.api.annotations to 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]
  • Introduced PlatformType enum in fr.maxlego08.menu.api.utils to detect and differentiate between Paper and Spigot servers at runtime, with convenience methods for platform checks.

Reflection and Utility Improvements

  • Added ReflectionsCache class to cache and efficiently reuse Reflections instances for plugin class scanning, improving performance and reducing redundant reflection operations.
  • Added a getMap() accessor to TypedMapAccessor for easier direct access to the underlying map.

Item Stack and Inventory API Changes

  • Changed AttackRangeComponent and MaxStackSizeComponent from concrete to abstract classes, and removed their apply methods, making them more extensible for future implementations. [1] [2]
  • Updated ZMenuItemStack to use the new MinecraftVersion class for version checks instead of NmsVersion, 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

  • Added actions_requirements() method to the Command interface, allowing commands to specify requirements that must be met before executing actions.
  • Added a debug field with getter/setter to the Action class for easier debugging of requirements/actions. [1] [2]

Inventory Management API

  • Added storeInventoryTemporaryOrClear(@NotNull Player) to InventoriesPlayer and clearInventory(@NonNull Player) to InventoryPlayer for more granular inventory management options. [1] [2]

Other minor changes include typo corrections and message description tweaks.

1robie added 26 commits April 12, 2026 17:07
… dependencies + use Reflexion to load ItemComponentLoader
@1robie 1robie marked this pull request as draft May 8, 2026 10:31
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.

1 participant