Skip to content

feat: add EquipBlockManager to handle item level restrictions#24

Merged
AzureDoom merged 1 commit intoAzureDoom:mainfrom
GlobalHive:main
Mar 1, 2026
Merged

feat: add EquipBlockManager to handle item level restrictions#24
AzureDoom merged 1 commit intoAzureDoom:mainfrom
GlobalHive:main

Conversation

@GlobalHive
Copy link

📌 Description

Adds an equipment restriction manager that enforces item level requirements when players try to equip armor, and wires its lifecycle into plugin startup/shutdown behind the existing item-restriction config flag.

When a player equips armor above their level, the equip action is rolled back, the item is returned to inventory, and a localized level-required message is sent.


🧪 Type of Change

Please check the types of changes your PR introduces:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Tests added / updated

👩‍💻 Implementation Details

Introduced an event-driven equipment guard that listens to inventory/armor transactions and reverts invalid equips based on configured item level mapping vs player level.

🛠 Changes

What was added

  • New EquipBlockManager system for armor equip validation and rollback.
  • Registration/unregistration hooks in plugin lifecycle when item level restriction is enabled.

What was removed

  • Nothing removed in this commit.

What was modified

  • Core plugin initialization/shutdown updated to start/stop the equipment restriction manager.
  • Inventory transaction handling now supports nested transaction rollback for invalid armor equips.
  • Player feedback message sent on restriction failure with required level, current level, and item id.

✅ Checklist

Go over all the following items and check them before submitting your PR:

  • My code follows the project’s code style (simply run spotlessApply to apply formatting)
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • My changes generate no new warnings

@AzureDoom AzureDoom self-assigned this Feb 28, 2026
@AzureDoom AzureDoom added the enhancement New feature or request label Feb 28, 2026
@AzureDoom
Copy link
Owner

Not seeing anything offhand so gonna merge and test here locally!

@AzureDoom AzureDoom merged commit c4e30f0 into AzureDoom:main Mar 1, 2026
1 check passed
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.

2 participants