Skip to content

Conversation

@1robie
Copy link
Contributor

@1robie 1robie commented Oct 10, 2025

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.

@alwyn974 alwyn974 requested a review from Copilot October 10, 2025 11:21
Copy link
Contributor

Copilot AI left a 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{
Copy link

Copilot AI Oct 10, 2025

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.

Suggested change
public class ItemUpdaterListener extends ListenerAdapter{
public class ItemUpdaterListener extends ListenerAdapter {

Copilot uses AI. Check for mistakes.
if (itemData == null) continue;

MenuItemStack menuItemStack = itemData.menuItemStack();
Player owner = this.menuPlugin.getServer().getPlayer(player.getUniqueId());
Copy link

Copilot AI Oct 10, 2025

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.

Copilot uses AI. Check for mistakes.
this.itemStack = itemStack;
}

}
Copy link

Copilot AI Oct 10, 2025

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.

Copilot uses AI. Check for mistakes.
@Maxlego08 Maxlego08 merged commit 908f93d into Maxlego08:develop Nov 10, 2025
1 of 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