title: ArrayList is not working as expected
body: <p>(I'm still pretty new to coding)
  I'm trying to make a Minecraft plugin that has a command so that a player freezes when the command is typed, but my ArrayList is acting very weirdly.
  When I type the command (/freeze) the plugin sends a message to me saying that the target has been frozen. When I check the list with a piece of code that says it in chat (code below) it says it is empty. But when I do the command again, the function unFreeze, that requires the ArrayList has the name, still, works. But if I move and freeze myself that way, the name is added to the list and it works, even the code that checks the list and says it in chat says it is there, but even if I walk and the playername gets added to the list, the text that says that I'm frozen or unfrozen doesn't seem to get affected, it just toggles between the two, and the command doesn't do anything else.</p>
  
  <p>Code for checking the list:</p>
  
  <pre><code>public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
      if (label.equalsIgnoreCase("seefrozenlist")){
          for (String s : freezeListener.frozen){
              sender.sendMessage(s);
          }
      }
      return true;
  }
  </code></pre>
  
  <p>Code for adding the player:</p>
  
  <pre><code>if (freezeListener.frozen.contains(player.getName())){ //normally freezeListener.getFrozen.contains(...)
      freezeListener.unFreeze(player.getName());
      sender.sendMessage(ChatColor.translateAlternateColorCodes('&amp;',player.getDisplayName() + "&amp;e is no longer &amp;b&amp;lFROZEN"));
      player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;',"&amp;eYou are no longer &amp;b&amp;lFROZEN"));
      return true;
  }
  else {
      //freezeListener.freeze(player.getName());
      freezeListener.freeze(player.getName());
      sender.sendMessage(ChatColor.translateAlternateColorCodes('&amp;',player.getDisplayName() + "&amp;e is now &amp;b&amp;lFROZEN"));
      player.sendMessage(ChatColor.translateAlternateColorCodes('&amp;',"&amp;eYou are now &amp;b&amp;lFROZEN"));
      return true;
  }
  </code></pre>
  
  <p>Class that has the ArrayList:</p>
  
  <pre><code>public class FreezeListener implements Listener {
  // was private, is public for testing
  public ArrayList&lt;String&gt; frozen = new ArrayList&lt;&gt;();
  
  public ArrayList&lt;String&gt; getFrozen(){
      return frozen;
  }
  
  public void freeze(String name){
      //if (!(frozen.contains(name))){
          frozen.add(name.trim());
          Bukkit.getServer().getPlayer(name).sendMessage("\"" + name + "\" Freeze");
      //}
  }
  
  public void unFreeze(String name){
      if (frozen.contains(name)){
          frozen.remove(name);
          Bukkit.getServer().getPlayer(name).sendMessage("\"" + name + "\" Unfreeze");
      }
  }
  
  @EventHandler
  public void onPlayerMove(PlayerMoveEvent event){
      if (getFrozen().contains(event.getPlayer().getName().trim())){
          event.getPlayer().sendMessage("2");
          Location to = event.getFrom();
          to.setPitch(event.getTo().getPitch());
          to.setYaw(event.getTo().getYaw());
          event.setTo(to);
      }
      //For testing
      else {
          freeze(event.getPlayer().getName());
      }
  }
  </code></pre>