Skip to content

Enchant open-with-item action#233

Merged
1robie merged 1 commit intoMaxlego08:developfrom
1robie:developement
Mar 19, 2026
Merged

Enchant open-with-item action#233
1robie merged 1 commit intoMaxlego08:developfrom
1robie:developement

Conversation

@1robie
Copy link
Copy Markdown
Collaborator

@1robie 1robie commented Mar 19, 2026

This pull request introduces a new ClickAction enum to centralize and simplify the handling of click actions, and refactors the logic for loading click actions from configuration files in the InventoryLoader class. The changes improve code maintainability, make action mapping more flexible, and add better error handling and debugging information.

Refactoring and code improvements:

  • Added a new ClickAction enum in fr.maxlego08.menu.api.utils to group related Bukkit Action values and provide a convenient method for retrieving associated actions.
  • Refactored InventoryLoader to use the new ClickAction enum when parsing click actions from configuration, replacing direct use of Action.valueOf with ClickAction.valueOf(...).asActions(). This allows for more flexible and robust mapping of configuration strings to actions.

Error handling and debugging:

  • Enhanced error handling in InventoryLoader by logging a warning message when an invalid click action is encountered in the configuration, including the file path for easier debugging.

Code cleanup:

  • Cleaned up imports in InventoryLoader by consolidating multiple import statements into a single wildcard import for utility classes.
  • Added the import for the new ClickAction enum in InventoryLoader.…entoryLoader

@1robie 1robie merged commit cbdc238 into Maxlego08:develop Mar 19, 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.

1 participant