Skip to content

Conversation

@1robie
Copy link
Collaborator

@1robie 1robie commented Jan 26, 2026

This pull request refactors the way attribute modifiers are handled and loaded in the codebase, introducing a new AttributeWrapper abstraction and supporting an attribute merge strategy for greater flexibility. The changes also update the component loader to use the new structure and ensure proper plugin context is passed throughout. Additionally, there are minor tweaks to packet event handling logic.

Attribute Modifiers Refactor and Loader Enhancements:

  • Refactored AttributeModifiersComponent to use AttributeWrapper objects and an AttributeMergeStrategy, replacing the previous tuple-based approach. The component now relies on an AttributApplier for applying attributes and requires a MenuPlugin instance.
  • Updated SpigotAttributeModifiersItemComponentLoader to accept a MenuPlugin in its constructor, parse an optional attribute-merge-strategy from the configuration, and construct AttributeWrapper instances for each modifier. The loader now passes these to the updated AttributeModifiersComponent. [1] [2] [3] [4]
  • Changed the registration of SpigotAttributeModifiersItemComponentLoader in ZComponentsManager to provide the MenuPlugin instance.
  • Removed an unused import for SpigotPotionDurationScaleItemComponentLoader in ZComponentsManager.

Packet Event Handling:

  • Modified the logic in PacketAnimationListener to run tasks immediately if either the server is on the primary thread or the plugin is enabled (or not enabled, depending on the context), otherwise scheduling them for the next tick. [1] [2] [3]

@Maxlego08 Maxlego08 merged commit fb26cf7 into Maxlego08:develop Jan 27, 2026
2 checks passed
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.

2 participants