Why does it break

This commit is contained in:
obvWolf
2024-02-15 07:23:23 -06:00
parent 420d5a1866
commit 8031a501c6
13 changed files with 23 additions and 362 deletions

View File

@@ -52,6 +52,13 @@ tasks.withType(JavaCompile).configureEach {
}
}
tasks.register('copyDeps', Copy) {
from configurations.runtimeClasspath
into 'build/deps'
include '*.jar'
}
processResources {
def props = [version: version]
inputs.properties props
@@ -65,4 +72,4 @@ compileJava.options.encoding("UTF-8")
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}

Binary file not shown.

View File

@@ -148,15 +148,16 @@ public final class Sentinel extends JavaPlugin {
// Scheduled timers
Bukkit.getScheduler().runTaskTimer(this, AntiSpam::decayHeat,0, 20);
Bukkit.getScheduler().runTaskTimer(this, ProfanityFilter::decayScore,0,1200);
log.info("Finished!\n" +
" ____ __ ___ \n" +
"/\\ _`\\ /\\ \\__ __ /\\_ \\ \n" +
"\\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \n" +
" \\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \n" +
" /\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_ \n" +
" \\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\\n" +
" \\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/\n" +
" ]====---- Advanced Anti-Grief & Chat Filter ----====[");
log.info("""
Finished!
____ __ ___ \s
/\\ _`\\ /\\ \\__ __ /\\_ \\ \s
\\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
\\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
/\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
\\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
\\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
]====---- Advanced Anti-Grief & Chat Filter ----====[""");
}
public void loadConfig() {
@@ -238,7 +239,7 @@ public final class Sentinel extends JavaPlugin {
command = command.substring(1);
}
for (String blocked : Sentinel.mainConfig.plugin.dangerous) {
if (command.contains(blocked)) return true;
if (command.startsWith(blocked)) return true;
}
return false;
}

View File

@@ -20,7 +20,7 @@ final
String
ENCRYPTION_KEY
=
"If I am reading this and I am not a verified developer for Sentinel AntiNuke, I solely swear that my attempts to de-obfuscate this plugin are purely for rat checking, and have malicious intentions such as cracking, leaking, or ratting this plugin.";
"If I am reading this and I am not a verified developer for Sentinel AntiNuke, I solely swear that my attempts to de-obfuscate this plugin are purely for investigation, and have no malicious intentions such as cracking, leaking, or ratting this plugin.";
private
static
final

View File

@@ -44,6 +44,7 @@ public class LanguageFile implements JsonSerializable<LanguageFile> {
put("spam-block-warn", "Do not spam in chat! Please wait before sending another message.");
put("spam-mute-warn", "§cYou have been auto-punished for violating the anti-spam repetitively!");
put("spam-mute-notification", "§b§n%1$s§7 has been auto-muted by the anti spam! §8(§c%2$s§7/§4%3$s§8)");
put("url-warn", "§cDo not send urls in chat!");
}};
public LanguageFile() {}

View File

@@ -14,6 +14,7 @@ public class CMDBlockExecute implements CustomListener {
@EventHandler
private void onCommandBlock(ServerCommandEvent e) {
if (!Sentinel.mainConfig.plugin.cmdBlockWhitelist) return;
if (!(e.getSender() instanceof BlockCommandSender s)) return;
Block cmdBlock = s.getBlock();
if (CMDBlockWhitelist.canRun(cmdBlock)) return;

View File

@@ -60,7 +60,7 @@ public class AdvancedBlockers {
if (matcher.find()) {
e.setCancelled(true);
e.getPlayer().sendMessage(Text.prefix(Sentinel.language.get("unicode-warn")));
e.getPlayer().sendMessage(Text.prefix(Sentinel.language.get("url-warn")));
}
}

View File

@@ -1,111 +0,0 @@
# Sentinel 0.2.0
# ____ __ ___
#/\ _`\ /\ \__ __ /\_ \
#\ \,\L\_\ __ ___\ \ ,_\/\_\ ___ __\//\ \
# \/_\__ \ /'__`\/' _ `\ \ \/\/\ \ /' _ `\ /'__`\\ \ \
# /\ \L\ \/\ __//\ \/\ \ \ \_\ \ \/\ \/\ \/\ __/ \_\ \_
# \ `\____\ \____\ \_\ \_\ \__\\ \_\ \_\ \_\ \____\/\____\
# \/_____/\/____/\/_/\/_/\/__/ \/_/\/_/\/_/\/____/\/____/
# ]======------ Configuration & Setup Guide ------=====[
# Sentinel is inspired by WickBot.com
# Be sure to check out their amazing discord bot!
# If you need help, join the discord!
# https://discord.gg/sentinelmc v Use below if it expired
# https://sentinelauth.000webhostapp.com/discord.html
#
config:
plugin:
key: "beta" # Put your license key here. If you do not have one, join the discord to verify your purchase
lang: "en-us.json" # Languages
# --------------------------------
# Anti-Nuke Setup (Do this first)
# --------------------------------
prefix: "§d§lSentinel §8» §7" # Prefix of the plugin. Line below is the discord webhook for logs to be sent to
webhook: "https://discord.com/api/webhooks/id/token"
trusted: # List the UUIDs of players who are trusted, will bypass the plugin and be immune to logs and are able to re-op themeselves, as well as whitelist command blocks
- "049460f7-21cb-42f5-8059-d42752bf406f" # obvWolf
block-specific: true # Defaulted true | Weather or not to block ALL plugin specific commands from non-trusted members (EX: minecraft:execute) these will not be logged.
prevent-nbt: true # Defaulted true | Should NBT items be blocked from the creative hotbar
prevent-cmdblock-place: true # Defaulted true | Should Placing a command block get blocked
prevent-cmdblock-use: true # Defaulted true | Should using a command block get blocked
prevent-cmdblock-change: true # Defaulted true | Should changing a command block get blocked
prevent-cmdcart-place: true # Defaulted true | Should placing a command cart get blocked
prevent-cmdcart-use: true # Defaulted true | Should using a command cart get blocked
cmdblock-op-check: true # Defaulted true | Will check if a player is op'd before preforming actions against command blocks (To prevent spam from non oped users attempting command blocks, which they cant by default)
dangerous: # These commands can only be run by "trusted" users
- "op"
- "deop"
- "stop"
- "restart"
- "execute" # Could run commands as a trusted player
- "sudo" # same as above
- "esudo" # WATCH OUT FOR ESSENTIALS ALIASES !!!
- "fill" # Most client side nukers use it
- "setblock" # could setblock a command block with anything
- "data" # Could modify a command block to whatever they wanted
- "whitelist" # Could add other players to the whitelist
log-dangerous: true # Default true | Weather or not to log to discord when a dangerous command is executed
log-cmdblocks: true # Defaulted true | Log attempts of command-block place-ery in discord
log-nbt: true # Defaulted true | Should items and their NBT's be logged to discord
log-specific: false # Default false | Weather or not to log to discord when a plugin specific command is executed
logged: # Commands that will always be logged to discord when executed.
- "give"
- "item"
deop: true # Defaulted true | This will remove an untrusted player's operator permissions whenever they attempt dangerous actions
nbt-punish: false # Defaulted false | This will punish a player when they attempt to use an NBT item
cmdblock-punish: false # Defaulted false | This will punish a player when they attempt to use a command block
command-punish: false # Defaulted false | This will ban punish player when they attempt to use a dangerous command
specific-punish: false # Defaulted false | This will punish a player when they run a specific command (Not recomended)
punish-commands: # Commands to run when a dangerous action is to be punished. Use %player% for the punished player's name
- "smite %player%"
- "ban %player% ]=- Sentinel -=[ You have been banned for attempting a dangerous action. If you believe this to be a mistake, please contact the server owner."
reop-command: false # Defaulted false | This enables the command allowing trusted players to op themselves if they get deoped.
# -------------------------------
# Chat Filter Setup & AntiSpam
# -------------------------------
chat:
anti-unicode: true # Default true | Prevents all non A-Z 0-9 + specials from being sent in chat
anti-spam:
# AntiSpam Heat system
enabled: true # Default true | Enables/disables the entire anti-spam
default-gain: 1 # Default 1 | Heat gained as base for every message
low-gain: 2 # Default 2 | Heat gained when message is >25% similar
medium-gain: 4 # Default 4 | Heat gained when message is >50% similar
high-gain: 6 # Default 6 | Heat gained for >90% similarity
heat-decay: 1 # Default 1 | Heat lost every second
block-heat: 10 # Default 10 | The heat required to block the message
punish-heat: 25 # Default 25 | The heat required to punish the player
clear-chat: true # Default true | will run the clear chat command before a spam punishment
chat-clear-command: "cc" # Default cc | Command for if "clear-chat" is enabled
punish-command: "mute %player% 1m Please refrain from spamming!" # (Use %player% for the player's name placeholder)
log-spam: true # Default true | logs spam punishments to the webhook
anti-swear:
enabled: true # Default true | Enables/disables the entire anti-swear
low-score: 0 # Default 0 | How much score should you gain for not attempting a bypass
medium-low-score: 1 # Default 1 | How much score should you gain for "bad "bypass attempt
medium-score: 3 # Default 3 | How much score should you gain for "ok" bypass attempt
medium-high-score: 5 # Default 5 | How much score should you gain for "good" bypass attempt
high-score: 7 # Default 7 | How much score should be gained for "extreme" attempt to bypass
score-decay: 3 # Default 3 | Rate at which score is lost every minute
punish-score: 20 # Default 20 | how much score is required to get punished
strict-insta-punish: true # Default true | Should players get insta punished for any words on the "strict" list?
punish-command: "mute %player% 15m Do not attempt to bypass the Profanity Filter"
strict-command: "mute %player% 1h Discriminatory speech is not tolerated on this server!"
log-swear: true # Default true | Logs swear punishments to the webhook
leet-patterns: # Replacement patterns for "l33t" strings
'0': o
'1': i
'3': e
'4': a
'5': s
'6': g
'7': l
$: s
'!': i
'|': i
+: t
'#': h
'@': a
<: c
V: u
v: u

View File

@@ -1,55 +0,0 @@
false-positives: # Words that will falsly flag the anti-swear
- but then
- was scamming
- an alt
- can also
- analysis
- analytics
- arsenal
- assassin
- as saying
- assert
- assign
- assimil
- assist
- associat
- assum
- assur
- basement
- bass
- cass
- butter
- canvass
- cocktail
- cumber
- document
- evaluate
- exclusive
- expensive
- explain
- expression
- grape
- grass
- harass
- hotwater
- identit
- kassa
- kassi
- lass
- leafage
- libshitz
- magnacumlaude
- mass
- mocha
- pass
- phoebe
- phoenix
- push it
- sassy
- saturday
- scrap
- serfage
- sexist
- shoe
- stitch
- therapist

View File

@@ -1,38 +0,0 @@
{
"dictionary" : {
"if-you-see-this-lang-is-broken" : "Sentinel language is working!",
"no-permission" : "§cInsufficient Permissions!",
"cooldown" : "This action is on cooldown!",
"false-positive-report-success" : "Successfully reported a false positive!",
"no-online-player" : "§cYou must provide an online player to send a message to!",
"no-message-provided" : "§cYou must provide a message to send!",
"elevating-perms" : "Elevating your permissions...",
"log-elevating-perms" : "Elevating the permissions of %s",
"already-op" : "You are already a server operator!",
"log-already-op" : "The permissions of %s are already elevated! Retrying...",
"no-trust" : "You are not a trusted user!",
"no-user-reply" : "§cYou have nobody to reply to!",
"spy-enabled" : "SocialSpy is now enabled.",
"spy-disabled" : "SocialSpy is now disabled.",
"action-automatic" : "§7This action was preformed automatically\n§7by the §bSentinel Anti-Spam§7 algorithm.",
"action-automatic-reportable" : "§7This action was preformed automatically \n§7by the §bSentinel Profanity Filter§7 algorithm!\n§8§o(Click to report false positive)",
"unicode-warn" : "§cDo not send non standard unicode in chat!",
"message-sent" : "§d§lMessage §8» §b[§fYou §e>§f %1$s§b] §7%2$s",
"message-received" : "§d§lMessage §8» §b[§f%1$s §e>§f You§b] §7%2$s",
"spy-message" : "§d§lSpy §8» §b§n%1$s§7 has messaged §b§n%2$s§7.",
"spy-message-hover" : "§8]==-- §d§lSocialSpy §8--==[\n§bSender: §f%1$S\n§bReceiver: §f%2$S\n§bMessage: §f%3$S",
"profanity-mute-warn" : "You have been auto muted for repeated violation of the profanity filter! §7§o(Hover for more info)",
"profanity-mute-notification" : "§b§n%1$s§7 has been auto-muted by the anti-swear! §8(§c%2$s§7/§4%3$s§8)",
"slur-mute-warn" : "§cYou have been insta-punished by the anti-slur! §7§o(Hover for more info)",
"slur-mute-notification" : "§b§n%1$s§7 has been insta-muted by the anti-swear! §8(§c%2$s§7/§4%3$s§8)",
"swear-block-warn" : "§cPlease do not swear in chat! Attempting to bypass this filter will result in a mute! §7§o(Hover for more info)",
"swear-block-notification" : "§b§n%1$s§7 has triggered the anti-swear! §8(§c%2$s§7/§4%3$s§8)",
"spam-notification" : "§b§n%1$s§7 might be spamming! §8(§c%2$s§7/§4%3$s§8)",
"spam-notification-hover" : "§8]==-- §d§lSentinel §8--==[\n§bPrevious: §f%1$s\n§bCurrent: §f%2$s\n§bSimilarity §f%3$s",
"spam-block-warn" : "Do not spam in chat! Please wait before sending another message.",
"spam-mute-warn" : "§cYou have been auto-punished for violating the anti-spam repetitively!",
"spam-mute-notification" : "§b§n%1$s§7 has been auto-muted by the anti spam! §8(§c%2$s§7/§4%3$s§8)",
"filter-notification-hover" : "§8]==-- §d§lSentinel §8--==[\n§bOriginal: §f%1$s\n§bSanitized: §f%2$s\n§8§o(Click to report false positive)",
"severity-notification-hover" : "§8]==-- §d§lSentinel §8--==[\n§bOriginal: §f%1$s\n§bSanitized: §f%2$s\n§bSeverity: §c%3$s\n§7§o(click to report false positive)"
}
}

View File

@@ -1,57 +0,0 @@
nbt:
allow-name: true # Defaulted to true, weather or not to allow all item names durring creative inv event
allow-lore: true # Defaulted to true, weather or not to allow all item lore during creative inv event
allow-attributes: false # defaulted to false, weather or not to allow item attributes in a creative inv event
# Enchants
global-max-enchant: 5 # Defaulted to 5, if any enchantment is above this, it will get deleted. Set to 0 to disable all enchants from creative inv
# It is recommended to keep the ones defaulted to 1 at 1, as this will keep people who spam 32k onto every enchant will get caught
# All items
max-mending: 1 # Defaulted to 1
max-unbreaking: 3 # Defaulted to 3
max-vanishing: 1 # Defaulted to 1
# ARMOR
max-aqua-affinity: 1 # Defaulted to 1
max-blast-protection: 4 # Defaulted to 4
max-curse-of-binding: 1 # Defaulted to 1
max-depth-strider: 3 # Defaulted to 3
max-feather-falling: 4 # Defaulted to 4
max-fire-protection: 4 # Defaulted to 4
max-frost-walker: 2 # Defaulted to 2
max-projectile-protection: 4 # Defaulted to 4
max-protection: 4 # Defaulted to 4
max-respiration: 3 # Defaulted to 3
max-soul-speed: 3 # Defaulted to 3
max-thorns: 3 # Defaulted to 3
max-swift-sneak: 3 # Defaulted to 3
# MELEE WEAPONS
max-bane-of-arthropods: 5 # Defaulted to 5
max-efficiency: 5 # Defaulted to 5
max-fire-aspect: 2 # Defaulted to 2
max-looting: 3 # Defaulted to 3
max-impaling: 5 # Defaulted to 5
max-knockback: 2 # Defaulted to 2
max-sharpness: 5 # Defaulted to 5
max-smite: 5 # Defaulted to 5
max-sweeping-edge: 3 # Defaulted to 3
# RANGED WEAPONS
max-channeling: 1 # Defaulted to 1
max-flame: 1 # Defaulted to 1
max-infinity: 1 # Defaulted to 1
max-loyalty: 3 # Defaulted to 3
max-riptide: 3 # Defaulted to 3
max-multishot: 1 # Defaulted to 1
max-piercing: 4 # Defaulted to 4
max-power: 5 # Defaulted to 5
max-punch: 2 # Defaulted to 2
max-quick-charge: 3 # Defaulted to 3
# TOOLS
max-fortune: 3 # Defaulted to 3
max-luck-of-the-sea: 3 # Defaulted to 3
max-lure: 3 # Defaulted to 3
max-silk-touch: 1 # Defaulted to 1

View File

@@ -1,9 +0,0 @@
strict: # Very bad words to insta-punish for
- nigg
- niger
- nlgg
- nlger
- njgg
- tranny
- fag
- beaner

View File

@@ -1,79 +0,0 @@
blacklisted: # Swears to check for
- anal
- anus
- arse
- ass
- ballsack
- balls
- bastard
- bitch
- btch
- biatch
- blowjob
- bollock
- bollok
- boner
- boob
- bugger
- butt
- choad
- clitoris
- cock
- coon
- crap
- cum
- cunt
- dick
- dildo
- douchebag
- dyke
- feck
- fellate
- fellatio
- felching
- fuck
- fudgepacker
- flange
- gtfo
- hoe
- horny
- incest
- jerk
- jizz
- labia
- masturb
- muff
- nazi
- nipple
- nips
- nude
- pedophile
- penis
- piss
- poop
- porn
- prick
- prostit
- pube
- pussie
- pussy
- queer
- rape
- rapist
- retard
- rimjob
- scrotum
- sex
- shit
- slut
- spunk
- stfu
- suckmy
- tits
- tittie
- titty
- turd
- twat
- vagina
- wank
- whore