Program: 33918
Project: 33918
Buggy source:
/** 
 * Handle clicks to the Settings panel
 * @param event
 */
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onInventoryClick(InventoryClickEvent event){
  Player player=(Player)event.getWhoClicked();
  Inventory inventory=event.getInventory();
  if (inventory.getName() == null) {
    return;
  }
  int slot=event.getRawSlot();
  if (!inventory.getName().equals(plugin.myLocale(player.getUniqueId()).igsTitle)) {
    return;
  }
  event.setCancelled(true);
  if (event.getSlotType() == SlotType.OUTSIDE) {
    player.closeInventory();
    inventory.clear();
    return;
  }
  if (event.getClick().equals(ClickType.SHIFT_RIGHT)) {
    player.closeInventory();
    inventory.clear();
    player.updateInventory();
    return;
  }
  if (!player.getLocation().getWorld().equals(ASkyBlock.getIslandWorld()) && !player.getLocation().getWorld().equals(ASkyBlock.getNetherWorld())) {
    return;
  }
  if (!hasArmorStand && slot > lookup.size()) {
    return;
  }
  if (slot > (lookup.size() + 1)) {
    return;
  }
  SettingsFlag flag=null;
  if (lookup.containsKey(event.getCurrentItem().getType())) {
    flag=lookup.get(event.getCurrentItem().getType());
  }
 else   if (hasArmorStand && event.getCurrentItem().getType() == Material.ARMOR_STAND) {
    flag=SettingsFlag.ARMOR_STAND;
  }
  if (flag == null) {
    return;
  }
  Island island=plugin.getGrid().getIslandAt(player.getLocation());
  if (island != null && (player.isOp() || (island.getOwner() != null && island.getOwner().equals(player.getUniqueId())))) {
    plugin.getLogger().info("String_Node_Str" + flag.toString());
    if (player.hasPermission(Settings.PERMPREFIX + "String_Node_Str" + flag.toString())) {
      plugin.getLogger().info("String_Node_Str" + flag.toString());
      if (flag.equals(SettingsFlag.PVP) || flag.equals(SettingsFlag.NETHER_PVP)) {
        player.closeInventory();
        inventory.clear();
        if (!island.getIgsFlag(flag)) {
          if (pvpCoolDown.containsKey(player.getUniqueId())) {
            long setTime=pvpCoolDown.get(player.getUniqueId());
            long secondsLeft=Settings.pvpRestartCooldown - (System.currentTimeMillis() - setTime) / 1000;
            if (secondsLeft > 0) {
              player.sendMessage(ChatColor.RED + "String_Node_Str" + secondsLeft+ "String_Node_Str");
              return;
            }
            pvpCoolDown.remove(player.getUniqueId());
          }
          for (          Player p : plugin.getServer().getOnlinePlayers()) {
            if (island.onIsland(p.getLocation())) {
              if (flag.equals(SettingsFlag.NETHER_PVP)) {
                p.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.NETHER_PVP)+ "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsAllowed);
              }
 else {
                p.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.PVP)+ "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsAllowed);
              }
              if (plugin.getServer().getVersion().contains("String_Node_Str") || plugin.getServer().getVersion().contains("String_Node_Str")) {
                player.getWorld().playSound(player.getLocation(),Sound.valueOf("String_Node_Str"),1F,1F);
              }
 else {
                player.getWorld().playSound(player.getLocation(),Sound.ENTITY_ARROW_HIT,1F,1F);
              }
            }
          }
          island.toggleIgs(flag);
          final List<UUID> members=island.getMembers();
          plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
            @Override public void run(){
              for (              UUID playerUUID : members) {
                plugin.getWarpPanel().updateWarp(playerUUID);
              }
            }
          }
);
          return;
        }
 else {
          pvpCoolDown.put(player.getUniqueId(),System.currentTimeMillis());
          island.toggleIgs(flag);
          final List<UUID> members=island.getMembers();
          plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
            @Override public void run(){
              for (              UUID playerUUID : members) {
                plugin.getWarpPanel().updateWarp(playerUUID);
              }
            }
          }
);
          for (          Player p : plugin.getServer().getOnlinePlayers()) {
            if (island.onIsland(p.getLocation())) {
              if (flag.equals(SettingsFlag.NETHER_PVP)) {
                p.sendMessage(ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.NETHER_PVP) + "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsDisallowed);
              }
 else {
                p.sendMessage(ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.PVP) + "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsDisallowed);
              }
              if (plugin.getServer().getVersion().contains("String_Node_Str") || plugin.getServer().getVersion().contains("String_Node_Str")) {
                p.getWorld().playSound(p.getLocation(),Sound.valueOf("String_Node_Str"),1F,1F);
              }
 else {
                p.getWorld().playSound(p.getLocation(),Sound.ENTITY_FIREWORK_TWINKLE,1F,1F);
              }
            }
          }
        }
      }
 else {
        island.toggleIgs(flag);
      }
    }
    inventory.clear();
    player.openInventory(islandGuardPanel(player));
  }
}

Fixed version (ground truth):
/** 
 * Handle clicks to the Settings panel
 * @param event
 */
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onInventoryClick(InventoryClickEvent event){
  Player player=(Player)event.getWhoClicked();
  Inventory inventory=event.getInventory();
  if (inventory.getName() == null) {
    return;
  }
  int slot=event.getRawSlot();
  if (!inventory.getName().equals(plugin.myLocale(player.getUniqueId()).igsTitle)) {
    return;
  }
  event.setCancelled(true);
  if (event.getSlotType() == SlotType.OUTSIDE) {
    player.closeInventory();
    inventory.clear();
    return;
  }
  if (event.getClick().equals(ClickType.SHIFT_RIGHT)) {
    player.closeInventory();
    inventory.clear();
    player.updateInventory();
    return;
  }
  if (!player.getLocation().getWorld().equals(ASkyBlock.getIslandWorld()) && !player.getLocation().getWorld().equals(ASkyBlock.getNetherWorld())) {
    return;
  }
  if (!hasArmorStand && slot > lookup.size()) {
    return;
  }
  if (slot > (lookup.size() + 1)) {
    return;
  }
  SettingsFlag flag=null;
  if (lookup.containsKey(event.getCurrentItem().getType())) {
    flag=lookup.get(event.getCurrentItem().getType());
  }
 else   if (hasArmorStand && event.getCurrentItem().getType() == Material.ARMOR_STAND) {
    flag=SettingsFlag.ARMOR_STAND;
  }
  if (flag == null) {
    return;
  }
  Island island=plugin.getGrid().getIslandAt(player.getLocation());
  if (island != null && (player.isOp() || (island.getOwner() != null && island.getOwner().equals(player.getUniqueId())))) {
    if (player.hasPermission(Settings.PERMPREFIX + "String_Node_Str" + flag.toString())) {
      if (flag.equals(SettingsFlag.PVP) || flag.equals(SettingsFlag.NETHER_PVP)) {
        player.closeInventory();
        inventory.clear();
        if (!island.getIgsFlag(flag)) {
          if (pvpCoolDown.containsKey(player.getUniqueId())) {
            long setTime=pvpCoolDown.get(player.getUniqueId());
            long secondsLeft=Settings.pvpRestartCooldown - (System.currentTimeMillis() - setTime) / 1000;
            if (secondsLeft > 0) {
              player.sendMessage(ChatColor.RED + "String_Node_Str" + secondsLeft+ "String_Node_Str");
              return;
            }
            pvpCoolDown.remove(player.getUniqueId());
          }
          for (          Player p : plugin.getServer().getOnlinePlayers()) {
            if (island.onIsland(p.getLocation())) {
              if (flag.equals(SettingsFlag.NETHER_PVP)) {
                p.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.NETHER_PVP)+ "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsAllowed);
              }
 else {
                p.sendMessage(ChatColor.RED + "String_Node_Str" + ChatColor.BOLD+ plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.PVP)+ "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsAllowed);
              }
              if (plugin.getServer().getVersion().contains("String_Node_Str") || plugin.getServer().getVersion().contains("String_Node_Str")) {
                player.getWorld().playSound(player.getLocation(),Sound.valueOf("String_Node_Str"),1F,1F);
              }
 else {
                player.getWorld().playSound(player.getLocation(),Sound.ENTITY_ARROW_HIT,1F,1F);
              }
            }
          }
          island.toggleIgs(flag);
          final List<UUID> members=island.getMembers();
          plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
            @Override public void run(){
              for (              UUID playerUUID : members) {
                plugin.getWarpPanel().updateWarp(playerUUID);
              }
            }
          }
);
          return;
        }
 else {
          pvpCoolDown.put(player.getUniqueId(),System.currentTimeMillis());
          island.toggleIgs(flag);
          final List<UUID> members=island.getMembers();
          plugin.getServer().getScheduler().runTask(plugin,new Runnable(){
            @Override public void run(){
              for (              UUID playerUUID : members) {
                plugin.getWarpPanel().updateWarp(playerUUID);
              }
            }
          }
);
          for (          Player p : plugin.getServer().getOnlinePlayers()) {
            if (island.onIsland(p.getLocation())) {
              if (flag.equals(SettingsFlag.NETHER_PVP)) {
                p.sendMessage(ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.NETHER_PVP) + "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsDisallowed);
              }
 else {
                p.sendMessage(ChatColor.GREEN + plugin.myLocale(p.getUniqueId()).igs.get(SettingsFlag.PVP) + "String_Node_Str"+ plugin.myLocale(p.getUniqueId()).igsDisallowed);
              }
              if (plugin.getServer().getVersion().contains("String_Node_Str") || plugin.getServer().getVersion().contains("String_Node_Str")) {
                p.getWorld().playSound(p.getLocation(),Sound.valueOf("String_Node_Str"),1F,1F);
              }
 else {
                p.getWorld().playSound(p.getLocation(),Sound.ENTITY_FIREWORK_TWINKLE,1F,1F);
              }
            }
          }
        }
      }
 else {
        island.toggleIgs(flag);
      }
    }
    inventory.clear();
    player.openInventory(islandGuardPanel(player));
  }
}