Added injection-failed option setting

This commit is contained in:
rayzsyt committed 2026-02-27 22:32:27 +01:00
1 parent 6c3dc58cd6
commit e896ccb72d
3 files changed
+51

No files matched your search

@@ -0,0 +1,31 @@
package de.rayzs.pat.api.storage.config.settings;
import de.rayzs.pat.api.storage.storages.ConfigStorage;
import de.rayzs.pat.utils.StringUtils;
import de.rayzs.pat.utils.configuration.helper.ConfigSectionHelper;
public class InjectionFailedSection extends ConfigStorage {
public boolean ENABLED;
public ConfigSectionHelper<String> KICK_MESSAGE, CONSOLE_MESSAGE;
public InjectionFailedSection() {
super("injection-failed");
}
@Override
public void load() {
super.load();
ENABLED = new ConfigSectionHelper<Boolean>(this, "kick-on-failure", true).getOrSet();
KICK_MESSAGE = new ConfigSectionHelper<>(this, "kick-message", "&cInjection process failed! Please reconnect.");
CONSOLE_MESSAGE = new ConfigSectionHelper<>(this, "console-message", "&cInjection process failed! (%player%)");
}
public boolean isMalicious(String text) {
if(!ENABLED) return false;
return text.length() > 256
|| text.contains("nbt")
&& (StringUtils.countMatches('[', text) > 15 || StringUtils.countMatches('{', text) > 25);
}
}
@@ -218,6 +218,16 @@ patch-exploits:
alert-message: '%prefix% &4%player% &ctried to crash/lag the server.'
kick-message: '&cFailed to read packet! Please reconnect.'
# Small extra option on how to respond to players who failed
# the injection process. ONLY necessary for those who are using
# a "spoofer plugins" which creates fake players with a corrupt
# pipeline and does not provide any information on if a player is
# spoofed or not.
injection-failed:
kick-on-failure: true
kick-message: '&cInjection process failed! Please reconnect.'
console-message: '&cInjection process failed! (%player%)'
#>> HTP (Overwritten)
# This feature allows you to customize your server brand you see when you press F3.
# Normally there is something like 'Purpur', or 'Spigot'.
+10
View File
@@ -188,6 +188,16 @@ patch-exploits:
alert-message: '%prefix% &4%player% &ctried to crash/lag the server.'
kick-message: '&cFailed to read packet! Please reconnect.'
# Small extra option on how to respond to players who failed
# the injection process. ONLY necessary for those who are using
# a "spoofer plugins" which creates fake players with a corrupt
# pipeline and does not provide any information on if a player is
# spoofed or not.
injection-failed:
kick-on-failure: true
kick-message: '&cInjection process failed! Please reconnect.'
console-message: '&cInjection process failed! (%player%)'
# This feature allows you to customize your server brand you see when you press F3.
# Normally there is something like 'Purpur', or 'Spigot'.
# With this feature, you are able to change and even animate it.