-
Notifications
You must be signed in to change notification settings - Fork 31
Custom Item Management System #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces a comprehensive custom item management system that enables the creation, loading, and handling of custom items with support for item mechanics and listeners. The system includes an ItemJoin mechanic that allows items to be automatically given to players on first join and prevents certain inventory modifications.
- Adds a complete custom item management infrastructure with ItemManager interface and implementation
- Introduces the ItemJoin mechanic system for managing item behavior and protection
- Integrates new command functionality for giving custom items to players
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/items/default-items.yml | Configuration template for custom items with example structure |
| src/main/java/fr/maxlego08/menu/zcore/enums/Permission.java | Adds permission for the give item command |
| src/main/java/fr/maxlego08/menu/mechanics/itemjoin/ItemJoinMechanicListener.java | Event handler for ItemJoin mechanic functionality and item protection |
| src/main/java/fr/maxlego08/menu/mechanics/itemjoin/ItemJoinMechanicFactory.java | Factory class for creating and managing ItemJoin mechanics |
| src/main/java/fr/maxlego08/menu/mechanics/itemjoin/ItemJoinMechanic.java | Core ItemJoin mechanic implementation with configuration options |
| src/main/java/fr/maxlego08/menu/listener/ItemUpdaterListener.java | Listener for updating items in player inventories on join |
| src/main/java/fr/maxlego08/menu/item/CustomItemData.java | Data record for storing custom item information and mechanic associations |
| src/main/java/fr/maxlego08/menu/command/commands/reload/CommandMenuReload.java | Updates reload command to include item manager reloading |
| src/main/java/fr/maxlego08/menu/command/commands/CommandMenuGiveItem.java | New command for giving custom items to players |
| src/main/java/fr/maxlego08/menu/command/commands/CommandMenu.java | Registers the new give item command |
| src/main/java/fr/maxlego08/menu/ZMenuPlugin.java | Integrates ItemManager into the main plugin lifecycle |
| src/main/java/fr/maxlego08/menu/ZItemManager.java | Core implementation of the item management system |
| API/src/main/java/fr/maxlego08/menu/api/utils/Message.java | Adds messages for item giving functionality |
| API/src/main/java/fr/maxlego08/menu/api/mechanic/MechanicListener.java | Base class for mechanic event listeners |
| API/src/main/java/fr/maxlego08/menu/api/mechanic/MechanicFactory.java | Factory base class for creating and managing mechanics |
| API/src/main/java/fr/maxlego08/menu/api/mechanic/Mechanic.java | Base class for item mechanics |
| API/src/main/java/fr/maxlego08/menu/api/MenuPlugin.java | Adds ItemManager to the plugin interface |
| API/src/main/java/fr/maxlego08/menu/api/ItemManager.java | Interface defining item management operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| import org.bukkit.entity.Player; | ||
| import org.bukkit.event.player.PlayerJoinEvent; | ||
|
|
||
| public class ItemUpdaterListener extends ListenerAdapter{ |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space before opening brace. Should be ListenerAdapter { for consistent formatting.
| public class ItemUpdaterListener extends ListenerAdapter{ | |
| public class ItemUpdaterListener extends ListenerAdapter { |
| if (itemData == null) continue; | ||
|
|
||
| MenuItemStack menuItemStack = itemData.menuItemStack(); | ||
| Player owner = this.menuPlugin.getServer().getPlayer(player.getUniqueId()); |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is redundant and potentially confusing. The owner variable is set to the same player that was passed as parameter, making the lookup unnecessary. Use the player parameter directly instead of looking up by UUID.
| this.itemStack = itemStack; | ||
| } | ||
|
|
||
| } |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing empty line should be removed from the end of the file for cleaner formatting.
- Add OpGrantMethod enum with ATTACHMENT and SET_OP strategies - Add enable-player-commands-as-op-action config (disabled by default) - Add op-grant-method config to choose elevation strategy - Add BreweryX material format: "breweryx:<recipe>:<quality>"
This pull request introduces a new custom item management system to the project, enabling the creation, loading, and handling of custom items with support for item mechanics and listeners.