diff --git a/src/main/java/com/songoda/ultimatekits/gui/GUIDisplayKit.java b/src/main/java/com/songoda/ultimatekits/gui/GUIDisplayKit.java index c1cafd6..e2bedf7 100644 --- a/src/main/java/com/songoda/ultimatekits/gui/GUIDisplayKit.java +++ b/src/main/java/com/songoda/ultimatekits/gui/GUIDisplayKit.java @@ -149,6 +149,13 @@ public class GUIDisplayKit extends AbstractGUI { linkmeta.setLore(lore); link.setItemMeta(linkmeta); inventory.setItem(max - 5, link); + + registerClickable(max - 5, ((player1, inventory1, cursor, slot, type) -> { + player.closeInventory(); + String kitName = kit.getName(); + Kit kit = plugin.getKitManager().getKit(kitName); + kit.buy(player); + })); } for (ItemStack is : list) { @@ -218,13 +225,6 @@ public class GUIDisplayKit extends AbstractGUI { registerClickable(8, (player, inventory, cursor, slot, type) -> player.closeInventory()); - registerClickable(max - 5, ((player1, inventory1, cursor, slot, type) -> { - player.closeInventory(); - String kitName = kit.getName(); - Kit kit = plugin.getKitManager().getKit(kitName); - kit.buy(player); - })); - } @Override