Lists

Discussion in 'Plugin Development' started by GeekyCompz, Jan 3, 2014.

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

    GeekyCompz

    Hey, is there a way to make a list that can store two variables of data. I need so this happens:

    1. /CMD select <group_name>
    2. Sets the player name with the group_name.
    3. They click a block and it saves the data to a config. And knows what the group_name was.

    e.g:
    List<Player,String> SelectingPlayers = new ArrayList<Player,String>();

    (That doesn't work, btw).

    ~BytesCode
     
  2. Offline

    Jogy34

    You're looking for a map:
    Code:java
    1.  
    2. Map<String, String> selectedPlayers = new HashMap<String, String>();
    3. //Don't store players, it causes memory leaks. Store them by their name instead.
     
Thread Status:
Not open for further replies.

Share This Page