Open
Conversation
…ndling in menu item stack
… MenuItemStackLoader
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 enhancements and refactorings to the menu item stack building system, particularly around durability handling, context management, and item stack construction. The changes improve flexibility by supporting placeholder-based durability, add richer context to item building, and clean up code for better maintainability.
Durability and ItemStack Improvements:
intto aStringinZMenuItemStack, allowing for placeholder-based durability values and added new methods (getDura,parseDura) to support this. The legacygetDurabilitymethod is now deprecated. ([[1]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-b38284c0ff63ceb184858ecc788746921202ac0187409aab4da38e35f119d5cdR104-R123),[[2]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L55-R55),[[3]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L263-R287))[Common/src/main/java/fr/maxlego08/menu/ZMenuItemStack.javaL263-R287](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L263-R287))Context and API Enhancements:
getItemStack()toBuildContextand its implementation inZBuildContext, enabling the passing of a baseItemStackduring item construction. Also introduced a builder method for setting the base item stack. ([[1]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-5150cca036a8f78ee5c4576ad5334971c1240d581e5df80e8879e4fe1c8b8949R33-R34),[[2]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-119cc3c9803d66d1aa8013e77edb1e8c4644efe8b183bc6b201426bf0e7edaf8L1-R11),[[3]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-119cc3c9803d66d1aa8013e77edb1e8c4644efe8b183bc6b201426bf0e7edaf8R21),[[4]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-119cc3c9803d66d1aa8013e77edb1e8c4644efe8b183bc6b201426bf0e7edaf8R39-R48),[[5]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-119cc3c9803d66d1aa8013e77edb1e8c4644efe8b183bc6b201426bf0e7edaf8R68-R73))ZBuildContextfromcommontoapipackage, making it more accessible for API consumers. ([API/src/main/java/fr/maxlego08/menu/api/context/ZBuildContext.javaL1-R11](https://github.com/Maxlego08/zMenu/pull/237/files#diff-119cc3c9803d66d1aa8013e77edb1e8c4644efe8b183bc6b201426bf0e7edaf8L1-R11))Code Quality and Refactoring:
this.for improved clarity and consistency throughoutZMenuItemStack. ([[1]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L107-R113),[[2]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L121-R125),[[3]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L138-R155), etc.)[Common/src/main/java/fr/maxlego08/menu/ZMenuItemStack.javaL194-R218](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L194-R218))this) context. ([[1]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L297-R305),[[2]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L317-R315),[[3]](https://github.com/Maxlego08/zMenu/pull/237/files#diff-8ee6101b08df5d1ab53ebac20fb2dc86d74972948816c2a824ed09ffedcb5319L326-R324))These changes collectively enhance the flexibility and maintainability of the menu item stack system while improving support for dynamic and context-sensitive item properties.