Solved Match lore

Discussion in 'Plugin Development' started by ARCT3CK, Jul 26, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ARCT3CK

    I need some help guys, i'm trying to make a plugin for my server.
    There is the:
    Code:java
    1. Material.matchMaterial(striing);


    I need something like that but that matches lore, not material.
    Thanks
     
  2. Offline

    xTigerRebornx

    ARCT3CK Lore is stored in a List, you can simply call List#equals() to check if they are the same.
     
    ARCT3CK likes this.
  3. Offline

    ARCT3CK

    Can you provide an example please? I supposse you are talking about creating an ArrayList that stores the lore, and then call it with itemmeta.getLore().contains(arraylist);
    Sorry for my english.
    thanks
     
  4. Offline

    Niknea

    ARCT3CK
    PHP:
    if(meta1.getLore().equals(meta2.getLore()))
    You also don't need to check if it equals another ItemMeta's lore, I believe you can check if it equals anything thats like a string, like a string, displayname, etc.
     
    ARCT3CK likes this.
  5. Offline

    xTigerRebornx

    ARCT3CK I never said use contains, but you've got part of it down. You want to use equals(), comparing the two lists (lore and your List)
     
    ARCT3CK likes this.
  6. Offline

    ARCT3CK

    Okay, thanks for the help the code seems to work :D
     
Thread Status:
Not open for further replies.

Share This Page