title: AsyncPlayerChatEvent, Trying to see if a string from a string array is contained within another string from a second string array
body: <p>I am making a plugin for a Bukkit Minecraft server running version 1.6.4. The plugin is supposed to stop players from spamming, as well as censor swear words but allow certain words that have swear words embedded in them (e.g. HELLo, molASSes). I have created two string arrays. One containing all swear words and the second containing the "allowed" words. </p>
  
  <pre><code>String[] curse = {"Swear1", "Swear2", "etc..."};
  String[] allowed = {"Allowed1", "Allowed2", "etc..."};
  </code></pre>
  
  <p>What I am trying to is whenever a player speaks in chat, have the plugin check the message for any swears while ignoring spaces and special characters. </p>
  
  <p>Here is what I have so far (Sorry if it's a bit too messy):</p>
  
  <pre><code>public int seconds1 = 0;
  public int seconds2 = 0;
  public int spam = 0;
  
  @EventHandler
  public void onPlayerChat(AsyncPlayerChatEvent event){
  
      Player player = event.getPlayer();
      String name = player.getName();
      seconds2 = seconds1;
      seconds1 = ((int) (System.currentTimeMillis()));
  
      if (seconds1 - seconds2 &lt;= 2500){
  
          spam++;
  
          switch (spam){
  
          case 3: player.damage(1);
                  player.sendMessage(ChatColor.GOLD + "Spam Warning: " + ChatColor.RED + "Do not spam! Spamming reduces your health.");
                  break;
          case 4: player.damage(3);
                  break;
          case 6: player.damage(5);
                  player.sendMessage(ChatColor.GOLD + "Spam Warning: " + ChatColor.RED + "I'm warning you.");
                  break;
          case 7: player.damage(6);
                  break;
          case 8: player.damage(10);
                  player.kickPlayer("What did I tell you about spamming?");
  
                  for(Player p : Bukkit.getOnlinePlayers()){
  
                      p.sendMessage(ChatColor.BLUE + name + ChatColor.RED + " has been kicked for spamming!");
  
                  }
  
                  spam = 0;
  
                  break;
  
          }
  
      }else if(seconds1 - seconds2 &gt; 2000){
  
          spam = 0;
  
      }
  
      String message = event.getMessage().toLowerCase().replace("-", "").replace(" ", "").replace(",", "")
                  .replace(".", "").replace("~", "").replace("!", "").replace("@", "").replace("#", "")
                  .replace("$", "").replace("%", "").replace("^", "").replace("&amp;", "").replace("*", "")
                  .replace("(", "").replace(")", "").replace("_", "").replace("+", "").replace("=", "")
                  .replace("{", "").replace("}", "").replace("[", "").replace("]", "").replace("|", "")
                  .replace("'", "").replace("&lt;", "").replace("&gt;", "").replace("/", "").replace("?", "")
                  .replace("`", "").replace("¸", "").replace("^", "").replace("@", "a");
  
      String[] curse = {"All", "Curse", "Words"};
      //I won't list the swears in this post.
      String[] allowed = {"All", "Allowed", "Words"};
  
      for(String blacklist : curse){
  
          if(message.contains(blacklist)){
  
              for (int i = 0; i &lt; allowed.length; i++){
  
                  if(allowed[i].contains(blacklist)){
                      event.setCancelled(true);
                      }else{
  
                      event.setCancelled(true);
                      player.chat(message.replaceAll(blacklist, "*bleep*"));
                      player.damage(5);
                      return;
  
                  }
  
              }
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>The only thing that is not working is trying to find the swear words within the allowed words. Whatever I currently have in my code isn't working. </p>