Skip to content

Commit

Permalink
Menu issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Jun 24, 2024
1 parent 7a5b86f commit 5d791ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/dev/lrxh/neptune/utils/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,20 @@ public void openMenu(UUID playerUUID) {
}

for (Map.Entry<Integer, Button> buttonEntry : this.buttons.entrySet()) {
inventory.setItem(buttonEntry.getKey(), buttonEntry.getValue().getButtonItem(player));
set(inventory, buttonEntry.getKey(), buttonEntry.getValue().getButtonItem(player));
}

player.openInventory(inventory);
player.updateInventory();
changeMenu(playerUUID);
}

private void set(Inventory inventory, int slot, ItemStack itemStack){
if(slot < inventory.getSize()){
inventory.setItem(slot, itemStack);
}
}


public void changeMenu(UUID playerUUID) {
plugin.getMenuManager().openedMenus.remove(playerUUID);
Expand Down

0 comments on commit 5d791ae

Please sign in to comment.