@EventHandler
   public void onPlayerInteract(PlayerInteractEvent event){
      if(event.getClickedBlock() != null){
         /* Check if the right clicked block is a bookshelf */
         if(event.getClickedBlock().getType().compareTo(Material.BOOKSHELF) == 0
               && event.getAction().compareTo(Action.RIGHT_CLICK_BLOCK) == 0){
            // TODO Should the action replace the null clickedblock check?
            /* If the bookshelf has a spell, then determine if the player has a
             * high enough level to learn it */
            if(plugin.getShelfMap().get(event.getClickedBlock().getLocation()) != null){
               int levelReq;
               String spell = plugin.getShelfMap().get(event.getClickedBlock().getLocation());
               
               if(plugin.getLevelConfig().get(spell) != null)
                  levelReq = plugin.getLevelConfig().getInt(spell);
               else
                  levelReq = plugin.getLevelCap();
               
               if(levelReq > event.getPlayer().getLevel()){
                  event.getPlayer().sendMessage("Your level is too low to learn this spell");
                  event.setCancelled(true);
               }
            }
         }
      }
      
      /* Check book durability (level cap) if the player tries to use it */
      if(event.getPlayer().getItemInHand().getType().compareTo(Material.BOOK_AND_QUILL) == 0){
         if(event.getPlayer().getItemInHand().getDurability() > event.getPlayer().getLevel()){
            event.getPlayer().sendMessage("Your level is too low to use this book");
            event.setCancelled(true);
         }
      }
   }