The title might be a little confusing, here's what's happening. I've got this piece of code:
private List<String> aswear = Arrays.asList("anus", "arse", "arsehole", "ass", "ass-hat", "ass-jabber", "ass-pirate", "assbag"); // A list with all swears starting with a.
    String message = event.getMessage(); // When a player sends a message to the server, this is his message.
    boolean asSwear = false; // A boolean to check if his sentence has a double swear.
    for(String as : aswear) { // Loop through all the swears.
        if (asSwear == false) { // Check if there is already an a swear.
            if (message.contains(as)) { // If his message contains a swear
                event.setCancelled(true); // Remove the message from the server
                event.getBukkitPlayer().sendMessage(PredefinedMessages.PHOENIX_SWEARING_DETECTED.build()); // Send a message saying he sweared.
                asSwear = true; // Set the boolean to true because he sweared.
            }
        }
    }
My problem is that when a player writes "Bass" in his message it'll block, yet bass isn't a swear. It blocks because it contains 'ass' in the message. Does anybody have a fix to this issue?
 
     
     
     
     
     
     
    