package net.wayward_realms.waywardcharacters;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

import java.util.Arrays;

public class InventoryClickListener implements Listener {

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (event.getInventory().getTitle().equalsIgnoreCase("Equipment")) {
            if (event.isShiftClick()) {
                event.setCancelled(true);
                return;
            }
            if (event.getInventory() == event.getView().getTopInventory()) {
                if (Arrays.asList(0, 1, 2, 3, 4, 5, 9, 12, 13, 14, 18, 19, 20, 21, 22, 23).contains(event.getSlot())) {
                    event.setCancelled(true);
                    return;
                }
                if (Arrays.asList(6, 7, 8, 15, 16, 17, 24, 25, 26).contains(event.getSlot())) {
                    if (event.getCursor().getType() != Material.PAPER || !event.getCursor().hasItemMeta() || !event.getCursor().getItemMeta().hasDisplayName() || !event.getCursor().getItemMeta().getDisplayName().equals(ChatColor.YELLOW + "Scroll")) {
                        event.setCancelled(true);
                        return;
                    }
                }
            }
        }
    }

}

@@ -591,89 +591,8 @@
   %7D%0A
-            if (event.getInventory() == event.getView().getTopInventory()) %7B%0A    
     
@@ -684,32 +684,35 @@
 ntains(event.get
+Raw
 Slot())) %7B%0A     
@@ -714,36 +714,32 @@
                 
-  
-  
 event.setCancell
@@ -756,36 +756,32 @@
                 
-    
 return;%0A        
@@ -780,34 +780,26 @@
             
-    %7D%0A    
+%7D%0A
             
@@ -867,16 +867,19 @@
 vent.get
+Raw
 Slot()))
@@ -889,36 +889,32 @@
                 
-    
 if (event.getCur
@@ -1140,36 +1140,32 @@
                 
-    
 event.setCancell
@@ -1190,36 +1190,32 @@
             
-    
 return;%0A
             
@@ -1206,30 +1206,8 @@
 rn;%0A
-                    %7D%0A
     

Fix equipment inventory