Map Teleportation using HashMaps?

Discussion in 'Plugin Development' started by frozenpoptartmc, May 27, 2013.

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

    frozenpoptartmc

    I'm creating this minigame and I would like to create multiple maps for it. I haven't really used HashMaps very much other than to store players for a short time. Can you add Locations to a HashMap, and then teleport players to that location?
    so
    Code:java
    1.  
    2. public final HashMap<Location, String> location = new HashMap<Location, String>();
    3.  

    and then
    Code:text
    1.  
    2. location.put(player.getLocation(), "mapone");
    3.  

    but I don't know if it's possible to actually get the location from the hashmap.
    This might be a really simple thing to do but
     
  2. Offline

    vemacs

    Yeah? And?
     
  3. Offline

    frozenpoptartmc

     
  4. Offline

    zeeveener

    A) I would guess, Yes.
    B) Have you tried this yourself?
    C) A better hashmap would be HashMap<String, Location> so you can use map.get("mapone");
     
Thread Status:
Not open for further replies.

Share This Page