Not sure what to use....

Discussion in 'Plugin Development' started by Mineblemone, Jul 1, 2013.

Thread Status:
Not open for further replies.
  1. Hello all, I'm not sure what kind of data storage to use for this:

    I need it to:
    When an event is triggered (I mean command or event), it stores the players name with an integer.
    When another one is triggered, it removes it.
    When another one is triggered, it chooses an integer at random and returns the players name assigned to it.
    When another one is triggered, it transfers it to another data storage thing.
    When another one is triggered, it checks if the player is in the second data storage, before giving him items.
    When another one is triggered, it clears both of the data storages and teleports all players in them to a certain location.
    How would I go about doing this?
     
  2. Offline

    Compressions

    Mineblemone Your explanations were very vague, however, I would recommend using HashMaps.
     
  3. Compressions
    How would you get ALL players in a hashmap?
     
  4. Offline

    Compressions

    Code:
    for(Player online : Bukkit.getOnlinePlayers()) {
    hashmap.put(playerName, integer);
    }
     
  5. Compressions
    I mean, how do I do something to everyone in a hashmap?
    And, can I replace or delete values in hashmaps?
     
  6. Offline

    MrZoraman

  7. MrZoraman
    How would you replace/delete values?

    MrZoraman
    Also, the code given in that answer was confusing, I'm not sure what was a variable... How would I set all string values to "Denied" on a hashmap called "Entry"?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
Thread Status:
Not open for further replies.

Share This Page