package me.AKZOMBIE74;

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;

/**
 * Created by AKZOMBIE74 on 1/22/2016.
 */
public class ICE implements Listener {

    @EventHandler
    public void clickI(InventoryClickEvent e) {

        if (e.getInventory().getName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', Selector.getInstance().getConfig().getString("menu_name")))) {

            Player p = (Player) e.getWhoClicked();


            if (e.getCurrentItem() == null || e.getCurrentItem().getType() == Material.AIR || !e.getCurrentItem().hasItemMeta()) {
                p.closeInventory();
                return;
            }
            if (e.getClick().isShiftClick()){
                e.setCancelled(true);
                return;
            }
            switch (e.getCurrentItem().getType()) {
                default:
                    for (String key : Selector.getInstance().getSectionKeys()) {
                        int sl = Selector.getInstance().getConfig().getInt("Servers."+key+".slot");
                        String name = Selector.getInstance().getConfig().getString("Servers."+key+".name");
                        if (e.getSlot()==sl) {
                            Selector.getInstance().getSelected().put(p.getUniqueId(), name);
                            break;
                        }
                    }
                    p.performCommand("ss");
                    p.closeInventory();
                    break;
            }
        }

    }
}

@@ -632,24 +632,55 @@
 name%22)))) %7B%0A
+            String name = null;
 %0A           
@@ -1310,116 +1310,8 @@
 %22);%0A
-                        String name = Selector.getInstance().getConfig().getString(%22Servers.%22+key+%22.name%22);%0A
     
@@ -1380,16 +1380,23 @@
         
+ name =
  Selecto
@@ -1418,44 +1418,49 @@
 .get
-Selected().put(p.getUniqueId(), 
+Config().getString(%22Servers.%22+key+%22.
 name
+%22
 );%0A 
@@ -1581,17 +1581,23 @@
 mand(%22ss
-%22
+ %22+name
 );%0A     

Update ICE.java