title: Comparing Values from a HashMap's ArrayList
body: <p>So I am trying to make a command in Bukkit that will teleport to a new player (one that hasn't played for more than thirty minutes) so they can welcome them. Everything is working great, but I realized that players can spam this command and continuously teleport to the same player to exploit the experience reward you get for welcoming players.</p>
  
  <p>I tried fixing this issue by making a HashMap with a List, but it doesn't seem to fix the issue. Here is my code</p>
  
  <pre><code>//Map that is having the issues.
  Map&lt;String, List&lt;String&gt;&gt; welcome = new HashMap&lt;String, List&lt;String&gt;&gt;();
  //This is set to true if a player is matched
  boolean found = false;
  //This is just initialized before the loop.
  Player targetPlayer = player;
  
  //I'm checking if the HashMap contains the player that executed this command
  if(!welcome.containsKey(player.getName()))
  {
      welcome.put(player.getName(), new ArrayList&lt;String&gt;());
  }
  
  //The "welcome" is an ArrayList that contains players that have not been
  //online for more than thirty minutes.
  for(String offlinePlayer : TheAura.welcome)
  {
      //This is to check if player is online.
      Player onlinePlayer = Bukkit.getPlayer(offlinePlayer);
      //Ditto from above.
      if(onlinePlayer != null)
      {
          //This is where the issue lies I believe. It's checking if the
          //HashMap contains the target player.
          if(!welcome.get(player.getName()).contains(onlinePlayer.getName()))
          {
              //Checks the player's mode, ignore
              String mode1 = TheAura.settings.getData().getString(onlinePlayer.getUniqueId() + ".mode");
              //Ditto from above.
              if(mode1.equalsIgnoreCase("easy"))
              {
                  //If passed all of this, found is true.
                  found = true;
                  //Variable from earlier
                  targetPlayer = onlinePlayer;
                  //Since it found a match, add the target player to the Map's
                  //List.
                  welcome.get(player.getName()).add(onlinePlayer.getName());
              }
          }
      }
  }
  </code></pre>
  
  <p>I'm sure that I'm missing one tiny little thing and it's just a stupid mistake, but I really can't figure out what's wrong :/ Any help is GREATLY appreciated.</p>
  
  <p>EDIT: Okay, extremely sorry that some of you don't understand. I added comments. I also debugged a bit of this, the Map outputs "{Shortninja66=[Shortninja66]}", which is what confuses me. The map has the same in it, but it does not see it in the if statement?</p>
  
  <p>Imagine the Map works like this:
  Shortninja66 (player that has welcomed some players): player1, player2.
  Player1 (Another player that has welcomed): Shortninja66.
  Hopefully this makes just a bit of sense. I want each player to have their own List of players that they have welcomed..</p>