Help with Map Variables

Discussion in 'Plugin Development' started by Alvarez96, Jul 1, 2012.

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

    Alvarez96

    This variable "Loc" I would like to hold a player and a given location:
    Code:
        public static Map<Player, Location> Loc = new HashMap<Player, Location>(); 
    This is how I am putting the data into the variable:
    Code:
                Player player = event.getPlayer();
            Loc.put(player, player.getLocation());

    Now I am confused on how to then use the data I put into the variable.
    Code:
                Player player = (Player) event.getEntity();
                        if(Loc.containsKey(player)){
                            player.teleport(Loc.get(I WANT THE LOCATION I STORED EARLIER!));
    Hopefully that explained my situation to where you can help.
    All help would be awesome since I am a new Bukkit coder and greatly appreciated :)
     
  2. Offline

    Firefly

    Loc.get(player)
     
Thread Status:
Not open for further replies.

Share This Page