title: Bukkit adding multi lores through split() | everytime player does has \n in config
body: <p>Whenever a player does lore:\ndog the <strong>\n</strong> should add a new loreline so if the so if a player does lore:\ndog1\ndog2(in the config) it should add 2 lores the first one being dog1 and the second one being dog2. </p>
  
  <p>The problem is that it's not even returning the correct lore it's always returning the bottom items lore 50 times by 50 times I mean there would be 50 lines of lores for that both of the items in the config</p>
  
  <hr>
  
  <p>9:46PM
  9-7-2015
  Question restated:
  What i'm trying to do is add a new lore line everytime a player has a \n in there part[1] so if a player has a lore:dog\ndog it makes new lore line because 
  "\n" is suppose to grant you a new line!</p>
  
  <hr>
  
  <pre><code>public ArrayList&lt;String&gt; lorelist;
      public ItemStack applyLore(ItemStack stack, String name, String lore1)
      {
          ItemMeta meta = stack.getItemMeta();
          meta.setDisplayName(name.replaceAll("&amp;([0-9a-f])", "\u00A7$1"));
          lorelist = new ArrayList();
         // lorelist.add(lore1.replaceAll("&amp;([0-9a-f])", "\u00A7$1"));
          meta.setLore(lorelist);
          stack.setItemMeta(meta);
          return stack;
      }
  
  function test(World world, Player p)
        String labels = "name: lore:";
        String[] parts = labels.split(" ");
        String name = parts[0];
        String lore = parts[1];
        if (b instanceof Chest) {
  
            if (chest.getInventory().getSize() == 27) {
                if (s.contains("restrict:singlechest")) {
                    if (chance &lt; Integer.parseInt(s.substring(itemchance.length()).split(" ")[2].replace("chance", "").replace("chan", "").replace("ance", "").replace(":", ""))) {
  
                        chest.getBlockInventory().addItem(applyLore(new ItemStack(Integer.parseInt(s.split(" ")[0]), amountgot),
                            s.substring(name.length()).split(" ")[0].replace("_", " ").replace("ame:", "").replace("e:", ""),
                            s.substring(lore.length()).split(" ")[1].replace("_", " ").replace("lore:", "")));
                        for (int i = lore.length(); i &lt; lore.length(); i++) {
                            lorelist.add(lore.substring(lore.length()).split("\n")[i].replaceAll("&amp;([0-9a-f])", "\u00A7$1").replaceAll("lore", ":"));
  
                            break;
  
                        }
                        break;
                    }
                }
            }
  }
  </code></pre>
  
  <p>Config</p>
  
  <pre><code>    ChestPopulater:
    items:
    - 126 name:&amp;9Thor_Godly_Axe lore:1st_lore_line\n&amp;7second_lore_line chance:99 maxamount:1 restrict:doublechest
    - 276 name:&amp;9testblade lore:dog1\ndog2\ndog3 chance:99 maxamount:1 restrict:singlechest
  </code></pre>
  
  <p>Updates:
  9:40PM 9/27/2015
  I tried the following still didn't work</p>
  
  <pre><code>         for ( int i = 0; i &lt; lore.length(); i++ )
              {
                 if ( Integer.toString(i).contains("\n") )
                 {
                      lorelist.add(Integer.toString(i).replaceAll("&amp;([0-9a-f])", "\u00A7$1"));
                      Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "Debug");
                 }
              }
  </code></pre>