AdvSwearBlock 1.0.2

An advanced swear block plugin, toggle-able per player, that replaces naughty words with asterisks.

  1. dordsor21
    Tested Minecraft Versions:
    • 1.12
    Source Code:
    https://gitlab.com/dordsor21/AdvSwearBlock
    Contributors:
    dordsor21
    upload_2018-6-10_11-10-41.png
    AdvSwearBlock

    An advanced Swear-Block toggle-able per player that replaces naughty words with asterisks. It also has a few extra things like ignoring, space-checking and chat cool-downs.

    Requires: ProtocolLib

    Configurable ignoring feature (requires SQL) as well as space-checking (n o - o n e l i k e s t h i s !) and chat cooldown! All plugin messages are configurable in the config, as well as the list of swear-words, any false-positives and the core behaviour the of the swear-blocker. The only swear-block that allows players to turn it on or off for just themselves, and only censors the naughty words from messages!

    I am completely open to suggestions, pull-requests and tips on my code via the GitLab repo linked above.

    • /ignore [add|remove|list] {[player] <player2> <player3> ...} Ignore players!
    • /swearblock <on|off> Toggle or turn swear-block on or off
    • /asb reload [swearList, noSwearList, messages, all] Reload aspects of the plugin

    • asb.admin gives access to /asb reload
    • asb.ignore gives access to /ig add
    • asb.unignore gives access to /ig remove
    • asb.list gives access to /ig list
    • asb.swear gives access to /sb [on|off]
    • asb.swear.toggle gives access to /sb
    • asb.bypass.cooldown bypass chat cooldown
    • asb.bypass.spacecheck bypass chat spacecheck

    Code (Text):
    ##############################
    #                            #
    #     Advanced SwearBlock    #
    #        By dordsor21        #
    #                            #
    ##############################
    #
    #
    #
    # Whether to use MySQL or not. !!Required for use of ignoring!!
    persistence: true
    # Enabled detecting messages with a lot of spaces l i k e t h i s. Limit is the maximum
    #  fraction of spaces divided by none-spaces allowed
    spaces:
        enabled: true
        limit: 0.45
    # Enables a cooldown (in ms) between chat messages
    cooldown:
        enabled: true
        length: 1500
    prefix: "&2[AdvSB]&r "
    SQL:
        username: user
        password: pass
        database: asb
        hostname: 127.0.0.1
        port: 3306
        autoreconnect: true
        useSSL: false
    # If a chat packet contains an ignored player, the chat packet will not be sent!
    # !!Requires persistence true and a working MySQL connection!!
    ignoring:
        enabled: true
        # If the chat packet contains one of these strings, it cannot be ignored. Useful for
        #  making sure broadcasts, admins, moderators etc cannot be ignored.
        noIgnoringPacketIfContains:
          - "[Broadcast]"
          - "[Admin]"
          - "[Moderator]"
    swearing:
        # List of false-positives you receive. Examples below display words contains "ass"
        not-blocked:
          - asset
          - pass
          - class
          - bass
        # If a word contains a blocked word, and is less long than this value multiplied by the
        #  length of the blocked word, the word will still get blocked.
        # For example, a multiplier of 2 will block "fuckwit" if "fuck" is blocked, but not
        #  "fucktard".
        # Lower values will reduce the chance of false-positives, but require you to put more
        #  swear-words containing smaller swear words in the swearlist.txt (makes the process
        #  longer.
        # Higher values mean you can skip adding words such as "fucktard" to swearlist.txt if you
        #  have blocked the word "*fuck" and have a multiplier higher than 2, making the process
        #  faster.
        # Minimum value of 1.
        swearWordMultiplier: 1.5
    messages:
        notPlayer: "Must be a player"
        spaceLimit: "There's a lot of spaces in that message. Please don't spam!"
        cooldown: "There is a {{cooldown}} second wait between messages to reduce spam."
        noPermission: "No permission: {{permission}}"
        ignoreUsage: "Usage &6/ig add [player] <player2> <player3> ..."
        unignoreUsage: "Usage &6/ig remove [player] <player2> <player3> ..."
        ignoreListUsage: "Usage &6/ig [add|remove|list] {[player] <player2> <player3> ...}"
        swearBlockUsage: "Usage &6/sb [on|off]"
        asbUsage: "Usage: &6/asb reload [swearList, noSwearList, messages, all]"
        asbReloaded: "Reloaded {{component}}"
        ignoringNoone: "You are not ignoring anyone."
        ignoreSelf: "but why?"
        ignoredPlayersSuccess: "You have ignored: {{players}}"
        ignoredPlayersFailure: "UUID lookup failed for the following players: {{players}}"
        ignorePlayersAlready: "You were already ignoring: {{players}}"
        ignoredPlayerSuccess: "You have ignored {{player}}"
        ignoredPlayerFailure: "UUID lookup failed for {{player}}"
        ignorePlayerAlready: "You were already ignoring {{player}}"
        unignoredPlayersSuccess: "You have unignored: {{players}}"
        unignoredPlayersFailure: "UUID lookup failed for the following players: {{players}}"
        unignorePlayersAlready: "You are not ignoring: {{players}}"
        unignoredPlayerSuccess: "You have unignored {{player}}"
        unignoredPlayerFailure: "UUID lookup failed for {{player}}"
        unignorePlayerAlready: "You are not ignoring {{player}}"
        listIgnoredPlayers: "You are ignoring the following players: {{players}}"
        swearBlockOn: "Toggles swear-block on"
        swearBlockOff: "Toggles swear-block off"
        firstSwear: "You can toggle the swear filter off with /sb off"

    Ignoring:
    upload_2018-6-10_11-34-50.png

    Yes, I did actually go to the effort of ignoring a player, then took a screenshot of where there should have been a message (it's a screenshot of below the chat because the packet isn't actually sent to me, not just an empty message)

    Chat cooldown:
    upload_2018-6-10_11-35-1.png

    Space check:
    upload_2018-6-10_11-36-31.png

    Known Bugs:

    • Signs will not be censored if loaded not seen to be placed (rip 1.2-SNAPSHOT)
    ToDo
    • Check network-wide (Bungee/Lilypad) for online players.
    • Censor bad words in books
    • Test versions other than 1.12 and make it work in them if needs be

Recent Updates

  1. 1.0.2
  2. Version 1.0.1
  3. A couple of bug fixes

Recent Reviews

  1. NotMyFault
    NotMyFault
    5/5,
    Version: 1.0
    Neato little plugin. Finally a good plugin I can work with ^^
    Keep it up my friend ;)
  2. Feriach
    Feriach
    5/5,
    Version: 1.5-SNAPSHOT
    Great plugin! Works like a charm even with custom chat plugins and vanilla! I'll recommend it any day! Good job.