diff --git a/.gradle/8.5/checksums/checksums.lock b/.gradle/8.5/checksums/checksums.lock
index 6e5bdbb..d98fbb0 100644
Binary files a/.gradle/8.5/checksums/checksums.lock and b/.gradle/8.5/checksums/checksums.lock differ
diff --git a/.gradle/8.5/checksums/md5-checksums.bin b/.gradle/8.5/checksums/md5-checksums.bin
index 26cde16..7b4a32f 100644
Binary files a/.gradle/8.5/checksums/md5-checksums.bin and b/.gradle/8.5/checksums/md5-checksums.bin differ
diff --git a/.gradle/8.5/checksums/sha1-checksums.bin b/.gradle/8.5/checksums/sha1-checksums.bin
index 1f61a59..e062e11 100644
Binary files a/.gradle/8.5/checksums/sha1-checksums.bin and b/.gradle/8.5/checksums/sha1-checksums.bin differ
diff --git a/.gradle/8.5/executionHistory/executionHistory.bin b/.gradle/8.5/executionHistory/executionHistory.bin
index eb65610..4d7786f 100644
Binary files a/.gradle/8.5/executionHistory/executionHistory.bin and b/.gradle/8.5/executionHistory/executionHistory.bin differ
diff --git a/.gradle/8.5/executionHistory/executionHistory.lock b/.gradle/8.5/executionHistory/executionHistory.lock
index e52e314..6ac8603 100644
Binary files a/.gradle/8.5/executionHistory/executionHistory.lock and b/.gradle/8.5/executionHistory/executionHistory.lock differ
diff --git a/.gradle/8.5/fileHashes/fileHashes.bin b/.gradle/8.5/fileHashes/fileHashes.bin
index f35fb2b..df83d20 100644
Binary files a/.gradle/8.5/fileHashes/fileHashes.bin and b/.gradle/8.5/fileHashes/fileHashes.bin differ
diff --git a/.gradle/8.5/fileHashes/fileHashes.lock b/.gradle/8.5/fileHashes/fileHashes.lock
index fc878c3..40884a8 100644
Binary files a/.gradle/8.5/fileHashes/fileHashes.lock and b/.gradle/8.5/fileHashes/fileHashes.lock differ
diff --git a/.gradle/8.5/fileHashes/resourceHashesCache.bin b/.gradle/8.5/fileHashes/resourceHashesCache.bin
index e6e2d3e..1b93716 100644
Binary files a/.gradle/8.5/fileHashes/resourceHashesCache.bin and b/.gradle/8.5/fileHashes/resourceHashesCache.bin differ
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index b933d74..47b9456 100644
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin
index 6b849db..ac36257 100644
Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe
index f0fd358..ea57011 100644
Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 05eca02..905bd6f 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -13,5 +13,6 @@
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 307921d..8128301 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,6 +4,7 @@ import java.nio.file.Paths
plugins {
id 'java'
id 'com.gradleup.shadow' version '9.0.0-beta10'
+ id("xyz.jpenilla.run-paper") version "2.3.1"
}
group = project.group
@@ -47,17 +48,16 @@ repositories {
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.0")
- compileOnly "io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT"
+ compileOnly "io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.ow2.asm:asm-commons:9.5'
implementation files("libs/PDK-1.4.0.jar")
- compileOnly 'com.github.koca2000:NoteBlockAPI:1.6.3'
- implementation "com.github.retrooper:packetevents-spigot:2.7.0"
- implementation("de.tr7zw:item-nbt-api:2.14.1")
+ implementation "com.github.retrooper:packetevents-spigot:2.8.0"
+ implementation("de.tr7zw:item-nbt-api:2.15.0")
}
static def generateBuildId() {
- return new Date().format('HH:mm:ss')
+ return new Date().format('HH:mm:ss dd/MM/yyyy')
}
processResources {
@@ -69,99 +69,46 @@ processResources {
}
}
-
-task cleanPluginYml {
- doLast {
- def jarFile = shadowJar.archiveFile.get().asFile
- def tempDir = file("$buildDir/tmpCleanJar")
- tempDir.mkdirs()
-
- // Unpack the jar into a temporary directory
- copy {
- from zipTree(jarFile)
- into tempDir
- }
-
- // Delete any plugin.yml files from anywhere in the unpacked directory
- fileTree(tempDir).matching {
- include '**/plugin.yml'
- }.each { file ->
- file.delete()
- }
-
- // Repackage the jar without the plugin.yml files
- ant.zip(destfile: jarFile, basedir: tempDir)
- delete tempDir
- }
-}
-
-task injectPluginYml {
- doLast {
- def jarFile = shadowJar.archiveFile.get().asFile
- def tempDir = file("$buildDir/tmpJar")
- tempDir.mkdirs()
-
- // Unpack the jar that has been cleaned
- copy {
- from zipTree(jarFile)
- into tempDir
- }
-
- // Copy the already filtered plugin.yml from processed resources
- copy {
- from file("$buildDir/resources/main/plugin.yml")
- into tempDir
- }
-
- // Repackage the jar with the updated contents
- ant.zip(destfile: jarFile, basedir: tempDir)
- delete tempDir
- }
-}
-
shadowJar {
archiveClassifier.set('')
minimize()
-
mergeServiceFiles()
- exclude 'plugin.yml'
+ filesMatching('**/plugin.yml') { fileCopyDetails ->
+ def content = fileCopyDetails.file.text
+ def lines = content.split('\n')
+
+ if (lines.length == 0 || !lines[0].trim().equals('name: SentinelAntiNuke')) {
+ fileCopyDetails.exclude()
+ }
+ }
+
relocate("com.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.api")
relocate("io.github.retrooper.packetevents", "me.trouper.sentinel.packetevents.impl")
relocate("de.tr7zw.changeme.nbtapi", "me.trouper.sentinel.nbtapi.api")
-
}
-
task copyLibs {
doLast {
- // Define the source directory (Gradle cache) and the target directory
- def sourceDir = Paths.get("C:/Users/crvic/.gradle/caches/modules-2/files-2.1")
- def targetDir = Paths.get("${buildDir}/../deps") // Output directory
+ def sourceDir = Paths.get("${System.getProperty('user.home')}/.gradle/caches/modules-2/files-2.1")
+ def targetDir = Paths.get("${buildDir}/../deps")
- // Create the target directory if it doesn't exist
if (!Files.exists(targetDir)) {
Files.createDirectories(targetDir)
}
- // Recursively traverse the source directory and copy JAR files
Files.walk(sourceDir)
.filter { Files.isRegularFile(it) && it.toString().endsWith(".jar") }
.forEach { jarFile ->
- // Extract the file name (without the directory structure)
def fileName = jarFile.fileName.toString()
-
- // Define the target file path (flat structure)
def targetFile = targetDir.resolve(fileName)
- // Handle duplicate file names (if any)
if (Files.exists(targetFile)) {
println "Skipping duplicate file: ${fileName}"
return
}
- // Copy the JAR file to the target directory
Files.copy(jarFile, targetFile)
println "Copied: ${jarFile} -> ${targetFile}"
}
@@ -171,32 +118,30 @@ task copyLibs {
}
task obfuscate(type: JavaExec) {
- // Path to the obfuscator JAR
classpath = files('obf/grunt-main.jar')
-
- // Arguments to pass to the obfuscator (e.g., input and output directories)
args = [
'--config', 'obf/config.json'
]
}
tasks.withType(JavaCompile).configureEach {
+ options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
options.release = targetJavaVersion
}
}
-compileJava.options.encoding("UTF-8")
-
-tasks.withType(JavaCompile) {
- options.encoding = "UTF-8"
-}
-
test {
useJUnitPlatform()
}
build {
dependsOn(shadowJar)
- dependsOn injectPluginYml
+}
+
+tasks {
+ runServer {
+ dependsOn(shadowJar)
+ minecraftVersion("1.21.5")
+ }
}
\ No newline at end of file
diff --git a/build/classes/java/main/me/trouper/sentinel/Sentinel.class b/build/classes/java/main/me/trouper/sentinel/Sentinel.class
index 68a8209..21408e6 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/Sentinel.class and b/build/classes/java/main/me/trouper/sentinel/Sentinel.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/AdvancedConfig.class b/build/classes/java/main/me/trouper/sentinel/data/config/AdvancedConfig.class
index b82cb5b..ad799af 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/AdvancedConfig.class and b/build/classes/java/main/me/trouper/sentinel/data/config/AdvancedConfig.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Chat.class b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Chat.class
index 06de281..5f9c2bf 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Chat.class and b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Chat.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Plugin.class b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Plugin.class
index 4793a5f..ad20e3c 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Plugin.class and b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig$Plugin.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig.class b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig.class
index 5010e01..dc43403 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig.class and b/build/classes/java/main/me/trouper/sentinel/data/config/MainConfig.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/NBTConfig.class b/build/classes/java/main/me/trouper/sentinel/data/config/NBTConfig.class
index a81e4ca..0468c7b 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/NBTConfig.class and b/build/classes/java/main/me/trouper/sentinel/data/config/NBTConfig.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/ViolationConfig.class b/build/classes/java/main/me/trouper/sentinel/data/config/ViolationConfig.class
index 8f911fb..fe74770 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/ViolationConfig.class and b/build/classes/java/main/me/trouper/sentinel/data/config/ViolationConfig.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$AutomatedActions.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$AutomatedActions.class
index d0fab20..8b039ac 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$AutomatedActions.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$AutomatedActions.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Cooldown.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Cooldown.class
index 4d4db70..a02e4de 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Cooldown.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Cooldown.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Permissions.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Permissions.class
index fb2c442..76aceed 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Permissions.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Permissions.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$PlayerInteraction.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$PlayerInteraction.class
index 40830f9..4bcf20b 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$PlayerInteraction.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$PlayerInteraction.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Reports.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Reports.class
index f14191c..7512a38 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Reports.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Reports.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$SocialSpy.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$SocialSpy.class
index 1e1b73e..21c738b 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$SocialSpy.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$SocialSpy.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Profanity.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Profanity.class
index e6503fe..6e091db 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Profanity.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Profanity.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Spam.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Spam.class
index 574ca06..36d4d17 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Spam.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile$Violations$Chat$Spam.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile.class b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile.class
index d06244a..403f8bd 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile.class and b/build/classes/java/main/me/trouper/sentinel/data/config/lang/LanguageFile.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/CallbackCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/CallbackCommand.class
index c40c0d8..2fbd093 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/CallbackCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/CallbackCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/MessageCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/MessageCommand.class
index c3c6b34..9a2bdd8 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/MessageCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/MessageCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/ReopCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/ReopCommand.class
index 34b97f8..bd10657 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/ReopCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/ReopCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/ReplyCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/ReplyCommand.class
index c2fcd87..2830c7e 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/ReplyCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/ReplyCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/SentinelCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/SentinelCommand.class
index 3250697..631b8e8 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/SentinelCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/SentinelCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/commands/TrapCommand.class b/build/classes/java/main/me/trouper/sentinel/server/commands/TrapCommand.class
index 18a28e5..94ad539 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/commands/TrapCommand.class and b/build/classes/java/main/me/trouper/sentinel/server/commands/TrapCommand.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.class b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.class
index ba709da..390386b 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.class and b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.class b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.class
index 823d77e..8e94ea8 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.class and b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.class b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.class
index 2265bb8..0fbe4b2 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.class and b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.class b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.class
index 6d6a3cf..c6903ca 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.class and b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.class b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.class
index 6467124..ecff3ac 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.class and b/build/classes/java/main/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/gui/Items.class b/build/classes/java/main/me/trouper/sentinel/server/gui/Items.class
index 776614d..9b20bad 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/gui/Items.class and b/build/classes/java/main/me/trouper/sentinel/server/gui/Items.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/gui/MainGUI.class b/build/classes/java/main/me/trouper/sentinel/server/gui/MainGUI.class
index a26a05e..1419f12 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/gui/MainGUI.class and b/build/classes/java/main/me/trouper/sentinel/server/gui/MainGUI.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/gui/config/AntiNukeGUI.class b/build/classes/java/main/me/trouper/sentinel/server/gui/config/AntiNukeGUI.class
index b3761ac..d44ca9f 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/gui/config/AntiNukeGUI.class and b/build/classes/java/main/me/trouper/sentinel/server/gui/config/AntiNukeGUI.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.class b/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.class
index 49a7d25..d0d1886 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.class and b/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.class b/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.class
index 3cb9ef2..92dbdc9 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.class and b/build/classes/java/main/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/startup/Telemetry.class b/build/classes/java/main/me/trouper/sentinel/startup/Telemetry.class
index 653ad59..d86c2b3 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/startup/Telemetry.class and b/build/classes/java/main/me/trouper/sentinel/startup/Telemetry.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/FileUtils.class b/build/classes/java/main/me/trouper/sentinel/utils/FileUtils.class
index f6a338e..fabf7a0 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/FileUtils.class and b/build/classes/java/main/me/trouper/sentinel/utils/FileUtils.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/PlayerUtils.class b/build/classes/java/main/me/trouper/sentinel/utils/PlayerUtils.class
index 90babe8..340ea85 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/PlayerUtils.class and b/build/classes/java/main/me/trouper/sentinel/utils/PlayerUtils.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/ServerUtils.class b/build/classes/java/main/me/trouper/sentinel/utils/ServerUtils.class
index 2707241..bc8f767 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/ServerUtils.class and b/build/classes/java/main/me/trouper/sentinel/utils/ServerUtils.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/Text.class b/build/classes/java/main/me/trouper/sentinel/utils/Text.class
index f042c3a..b0d6514 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/Text.class and b/build/classes/java/main/me/trouper/sentinel/utils/Text.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/trees/ConsoleFormatter.class b/build/classes/java/main/me/trouper/sentinel/utils/trees/ConsoleFormatter.class
index 638fd98..2c44db7 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/trees/ConsoleFormatter.class and b/build/classes/java/main/me/trouper/sentinel/utils/trees/ConsoleFormatter.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/trees/EmbedFormatter.class b/build/classes/java/main/me/trouper/sentinel/utils/trees/EmbedFormatter.class
index 117fbec..fdf424e 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/trees/EmbedFormatter.class and b/build/classes/java/main/me/trouper/sentinel/utils/trees/EmbedFormatter.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/trees/HoverFormatter.class b/build/classes/java/main/me/trouper/sentinel/utils/trees/HoverFormatter.class
index a596fce..b943674 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/trees/HoverFormatter.class and b/build/classes/java/main/me/trouper/sentinel/utils/trees/HoverFormatter.class differ
diff --git a/build/classes/java/main/me/trouper/sentinel/utils/trees/Node.class b/build/classes/java/main/me/trouper/sentinel/utils/trees/Node.class
index 3b2a13c..0b1a79c 100644
Binary files a/build/classes/java/main/me/trouper/sentinel/utils/trees/Node.class and b/build/classes/java/main/me/trouper/sentinel/utils/trees/Node.class differ
diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin
index 1ee1c0b..0640d17 100644
Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ
diff --git a/config.json b/config.json
new file mode 100644
index 0000000..5a64fe0
--- /dev/null
+++ b/config.json
@@ -0,0 +1,368 @@
+{
+ "Settings": {
+ "Input": "./build/libs/Sentinel-1.0.0.jar",
+ "Output": "./build/libs/Sentinel-1.0.0-alfa.jar",
+ "Libraries": [
+ "./deps"
+ ],
+ "Exclusions": [
+ "com/",
+ "io/",
+ "me/trouper/sentinel/data/",
+ "me/trouper/sentinel/packetevents/",
+ "me/trouper/sentinel/nbtapi/",
+ "org/",
+ "net/",
+ "module-info"
+ ],
+ "MixinPackage": [
+ "net/spartanb312/client/mixins/"
+ ],
+ "DumpMappings": false,
+ "Multithreading": true,
+ "PrintTimeUsage": true,
+ "ForceUseComputeMax": false,
+ "LibsMissingCheck": true,
+ "CustomDictionaryFile": "./obf/dictionary.txt",
+ "DictionaryStartIndex": 0,
+ "CorruptOutput": false,
+ "FileRemovePrefix": [],
+ "FileRemoveSuffix": []
+ },
+ "UI": {
+ "DarkTheme": true
+ },
+ "SourceDebugRemove": {
+ "Enabled": true,
+ "SourceDebug": true,
+ "LineDebug": true,
+ "RenameSourceDebug": true,
+ "SourceNames": [
+ "AhAhAhYouDidntSayTheMagicWord.java",
+ "SentinelIsClosedSource.java",
+ "YourHonor-FreeBirdWasPlaying.kt",
+ "Officer-IDropKickedThatChildInSelfDefense.kt",
+ "NotTheBees.java",
+ "Youve-been-trolled.java",
+ "tuco-get-out.mp3.kt"
+ ],
+ "Exclusion": []
+ },
+ "Shrinking": {
+ "Enabled": true,
+ "RemoveInnerClass": true,
+ "RemoveUnusedLabel": true,
+ "RemoveNOP": false,
+ "AnnotationRemovals": [
+ "Ljava/lang/Override;"
+ ],
+ "Exclusion": []
+ },
+ "KotlinOptimizer": {
+ "Enabled": false,
+ "Annotations": true,
+ "Intrinsics": true,
+ "IntrinsicsRemoval": [
+ "checkExpressionValueIsNotNull",
+ "checkNotNullExpressionValue",
+ "checkReturnedValueIsNotNull",
+ "checkFieldIsNotNull",
+ "checkParameterIsNotNull",
+ "checkNotNullParameter"
+ ],
+ "ReplaceLdc": true,
+ "IntrinsicsExclusion": [],
+ "MetadataExclusion": []
+ },
+ "EnumOptimize": {
+ "Enabled": false,
+ "Exclusion": []
+ },
+ "DeadCodeRemove": {
+ "Enabled": false,
+ "Exclusion": []
+ },
+ "ClonedClass": {
+ "Enabled": false,
+ "Count": 2048,
+ "Suffix": "-on-top",
+ "RemoveAnnotations": true,
+ "Exclusion": []
+ },
+ "TrashClass": {
+ "Enabled": false,
+ "Package": "sentinel/",
+ "Prefix": "NUKE_",
+ "Count": 2048
+ },
+ "HWIDAuthentication": {
+ "Enabled": false,
+ "OnlineMode": true,
+ "OfflineHWID": [
+ "Put HWID here (For offline mode only)"
+ ],
+ "OnlineURL": "https://pastebin.com/XXXXX",
+ "EncryptKey": "1186118611861186",
+ "CachePools": 5,
+ "ShowHWIDWhenFailed": true,
+ "EncryptConst": true,
+ "Exclusion": []
+ },
+ "HideDeclaredFields": {
+ "Enabled": false,
+ "Exclusion": []
+ },
+ "ReflectionSupport": {
+ "Enabled": false,
+ "PrintLog": true,
+ "Class": true,
+ "Method": true,
+ "Field": true
+ },
+ "StringEncrypt": {
+ "Enabled": true,
+ "Arrayed": false,
+ "ReplaceInvokeDynamics": true,
+ "Exclusion": []
+ },
+ "NumberEncrypt": {
+ "Enabled": true,
+ "Intensity": 1,
+ "FloatingPoint": true,
+ "Arrayed": false,
+ "MaxInsnSize": 16384,
+ "Exclusion": []
+ },
+ "ArithmeticEncrypt": {
+ "Enabled": true,
+ "Intensity": 1,
+ "MaxInsnSize": 16384,
+ "Exclusion": []
+ },
+ "Controlflow": {
+ "Enabled": true,
+ "Intensity": 1,
+ "ExecuteBeforeEncrypt": false,
+ "SwitchExtractor": true,
+ "ExtractRate": 25,
+ "BogusConditionJump": true,
+ "GotoReplaceRate": 50,
+ "MangledCompareJump": true,
+ "IfReplaceRate": 48,
+ "IfICompareReplaceRate": 25,
+ "SwitchProtect": true,
+ "ProtectRate": 30,
+ "TableSwitchJump": true,
+ "MutateJumps": true,
+ "MutateRate": 10,
+ "SwitchReplaceRate": 30,
+ "MaxSwitchCase": 5,
+ "ReverseExistedIf": true,
+ "ReverseChance": 50,
+ "TrappedSwitchCase": true,
+ "TrapChance": 25,
+ "ArithmeticExprBuilder": true,
+ "BuilderIntensity": 1,
+ "JunkBuilderParameter": true,
+ "BuilderNativeAnnotation": false,
+ "UseLocalVar": true,
+ "JunkCode": true,
+ "MaxJunkCode": 2,
+ "ExpandedJunkCode": true,
+ "Exclusion": []
+ },
+ "ConstBuilder": {
+ "Enabled": true,
+ "NumberSwitchBuilder": true,
+ "SplitLong": true,
+ "HeavyEncrypt": false,
+ "SkipControlFlow": true,
+ "ReplacePercentage": 25,
+ "MaxCases": 3,
+ "Exclusion": []
+ },
+ "ConstPollEncrypt": {
+ "Enabled": false,
+ "Integer": true,
+ "Long": true,
+ "Float": true,
+ "Double": true,
+ "String": true,
+ "HeavyEncrypt": false,
+ "DontScramble": true,
+ "NativeAnnotation": false,
+ "Exclusion": []
+ },
+ "RedirectStringEquals": {
+ "Enabled": true,
+ "IgnoreCase": true,
+ "Exclusion": []
+ },
+ "FieldScramble": {
+ "Enabled": false,
+ "Intensity": 1,
+ "ReplacePercentage": 25,
+ "RandomName": false,
+ "GetStatic": true,
+ "SetStatic": true,
+ "GetValue": true,
+ "SetField": true,
+ "GenerateOuterClass": false,
+ "NativeAnnotation": false,
+ "ExcludedClasses": [],
+ "ExcludedFieldName": []
+ },
+ "MethodScramble": {
+ "Enabled": false,
+ "ReplacePercentage": 25,
+ "GenerateOuterClass": true,
+ "RandomCall": true,
+ "NativeAnnotation": false,
+ "ExcludedClasses": [],
+ "ExcludedMethodName": []
+ },
+ "NativeCandidate": {
+ "Enabled": false,
+ "NativeAnnotation": "Lnet/spartanb312/example/Native;",
+ "SearchCandidate": true,
+ "UpCallLimit": 0,
+ "Exclusion": [],
+ "AnnotationGroups": [
+ "{ \"annotation\": \"Lnet/spartanb312/grunt/Native;\", \"includeRegexes\": [\"^(?:[^./\\\\[;]+/)*[^./\\\\[;]+$\"], \"excludeRegexes\": [] }",
+ "{ \"annotation\": \"Lnet/spartanb312/grunt/VMProtect;\", \"includeRegexes\": [\"^(?:[^./\\\\[;]+\\\\/)*(?:[^./\\\\[;])+\\\\.(?:[^./\\\\[;()\\\\/])+(?:\\\\(((\\\\[*L[^./\\\\[;]([^./\\\\[;]*[^.\\\\[;][^./\\\\[;])*;)|(\\\\[*[ZBCSIJFD]+))*\\\\))((\\\\[*L[^./\\\\[;]([^./\\\\[;]*[^.\\\\[;][^./\\\\[;])*;)|V|(\\\\[*[ZBCSIJFD]))$\"], \"excludeRegexes\": [] }"
+ ]
+ },
+ "SyntheticBridge": {
+ "Enabled": false,
+ "Exclusion": [
+ "do not use this! (All Events will break)"
+ ]
+ },
+ "LocalVariableRename": {
+ "Enabled": true,
+ "Dictionary": "Custom",
+ "ThisReference": false,
+ "DeleteLocalVars": false,
+ "DeleteParameters": false,
+ "Exclusion": []
+ },
+ "MethodRename": {
+ "Enabled": true,
+ "Enums": true,
+ "Interfaces": false,
+ "Dictionary": "Custom",
+ "HeavyOverloads": false,
+ "RandomKeywordPrefix": false,
+ "Prefix": "",
+ "Reversed": false,
+ "Exclusion": [],
+ "ExcludedName": []
+ },
+ "FieldRename": {
+ "Enabled": true,
+ "Dictionary": "Custom",
+ "RandomKeywordPrefix": false,
+ "Prefix": "",
+ "Reversed": false,
+ "Exclusion": [],
+ "ExcludedName": [
+ "INSTANCE",
+ "Companion"
+ ]
+ },
+ "ClassRename": {
+ "Enabled": true,
+ "Dictionary": "Custom",
+ "Parent": "this/is/a/dying/meme/",
+ "Prefix": "",
+ "Reversed": false,
+ "Shuffled": false,
+ "CorruptedName": false,
+ "CorruptedNameExclusion": [],
+ "Exclusion": [
+ "me/trouper/sentinel/Sentinel"
+ ]
+ },
+ "MixinFieldRename": {
+ "Enabled": false,
+ "Dictionary": "Alphabet",
+ "Prefix": "",
+ "Exclusion": [],
+ "ExcludedName": [
+ "INSTANCE",
+ "Companion"
+ ]
+ },
+ "MixinClassRename": {
+ "Enabled": false,
+ "Dictionary": "Alphabet",
+ "TargetMixinPackage": "net/spartanb312/obf/mixins/",
+ "MixinFile": "mixins.example.json",
+ "RefmapFile": "mixins.example.refmap.json",
+ "Exclusion": []
+ },
+ "InvokeDynamic": {
+ "Enabled": true,
+ "ReplacePercentage": 25,
+ "HeavyProtection": false,
+ "MetadataClass": "me/trouper/tuco/getOutMetadata",
+ "MassiveRandomBlank": true,
+ "Reobfuscate": false,
+ "EnhancedFlowReobf": false,
+ "BSMNativeAnnotation": false,
+ "Exclusion": []
+ },
+ "ShuffleMembers": {
+ "Enabled": true,
+ "Methods": true,
+ "Fields": true,
+ "Annotations": true,
+ "Exceptions": true,
+ "Exclusion": []
+ },
+ "Crasher": {
+ "Enabled": false,
+ "Random": false,
+ "Exclusion": []
+ },
+ "Watermark": {
+ "Enabled": true,
+ "Names": [
+ "Copyright_SentinelAntiNuke2024",
+ "obvWolf",
+ "thetrouper"
+ ],
+ "Messages": [
+ "Ah_Ah_Ah_You_Didnt_Say_The_Magic_Word",
+ "%%__USERNAME__%%",
+ "%%__USER__%%"
+ ],
+ "FieldMark": true,
+ "MethodMark": true,
+ "AnnotationMark": false,
+ "Annotations": [
+ "ProtectedByGrunt",
+ "JvavMetadata"
+ ],
+ "Versions": [
+ "1984"
+ ],
+ "InterfaceMark": false,
+ "FatherOfJava": "linus/torvalds/thegoat/",
+ "CustomTrashMethod": false,
+ "CustomMethodName": "protected by YuShengJun",
+ "CustomMethodCode": "public static String method() {\n return \"Protected by YuShengJun\";\n}",
+ "Exclusion": []
+ },
+ "PostProcess": {
+ "Enabled": true,
+ "Manifest": true,
+ "Plugin YML": true,
+ "Bungee YML": false,
+ "Fabric JSON": false,
+ "Velocity JSON": false,
+ "ManifestPrefix": [
+ "Main-Class:"
+ ]
+ }
+}
diff --git a/deps/adventure-api-4.17.0.jar b/deps/adventure-api-4.17.0.jar
deleted file mode 100644
index bae00c0..0000000
Binary files a/deps/adventure-api-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-key-4.17.0.jar b/deps/adventure-key-4.17.0.jar
deleted file mode 100644
index b58fcfa..0000000
Binary files a/deps/adventure-key-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-nbt-4.17.0.jar b/deps/adventure-nbt-4.17.0.jar
deleted file mode 100644
index a2b172c..0000000
Binary files a/deps/adventure-nbt-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-logger-slf4j-4.17.0.jar b/deps/adventure-text-logger-slf4j-4.17.0.jar
deleted file mode 100644
index c9d8392..0000000
Binary files a/deps/adventure-text-logger-slf4j-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-minimessage-4.17.0.jar b/deps/adventure-text-minimessage-4.17.0.jar
deleted file mode 100644
index 8124660..0000000
Binary files a/deps/adventure-text-minimessage-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-serializer-gson-4.17.0.jar b/deps/adventure-text-serializer-gson-4.17.0.jar
deleted file mode 100644
index 2b7dd71..0000000
Binary files a/deps/adventure-text-serializer-gson-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-serializer-json-4.17.0.jar b/deps/adventure-text-serializer-json-4.17.0.jar
deleted file mode 100644
index b76611b..0000000
Binary files a/deps/adventure-text-serializer-json-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-serializer-legacy-4.17.0.jar b/deps/adventure-text-serializer-legacy-4.17.0.jar
deleted file mode 100644
index 6c15c06..0000000
Binary files a/deps/adventure-text-serializer-legacy-4.17.0.jar and /dev/null differ
diff --git a/deps/adventure-text-serializer-plain-4.17.0.jar b/deps/adventure-text-serializer-plain-4.17.0.jar
deleted file mode 100644
index 85debd2..0000000
Binary files a/deps/adventure-text-serializer-plain-4.17.0.jar and /dev/null differ
diff --git a/deps/annotations-24.1.0.jar b/deps/annotations-24.1.0.jar
deleted file mode 100644
index 28d234f..0000000
Binary files a/deps/annotations-24.1.0.jar and /dev/null differ
diff --git a/deps/ant-1.10.13.jar b/deps/ant-1.10.13.jar
deleted file mode 100644
index 6dad9ad..0000000
Binary files a/deps/ant-1.10.13.jar and /dev/null differ
diff --git a/deps/ant-launcher-1.10.13.jar b/deps/ant-launcher-1.10.13.jar
deleted file mode 100644
index 8718a72..0000000
Binary files a/deps/ant-launcher-1.10.13.jar and /dev/null differ
diff --git a/deps/asm-9.4.jar b/deps/asm-9.4.jar
deleted file mode 100644
index 01cb52e..0000000
Binary files a/deps/asm-9.4.jar and /dev/null differ
diff --git a/deps/asm-9.5.jar b/deps/asm-9.5.jar
deleted file mode 100644
index f5701dc..0000000
Binary files a/deps/asm-9.5.jar and /dev/null differ
diff --git a/deps/asm-commons-9.4.jar b/deps/asm-commons-9.4.jar
deleted file mode 100644
index 593621a..0000000
Binary files a/deps/asm-commons-9.4.jar and /dev/null differ
diff --git a/deps/asm-commons-9.5.jar b/deps/asm-commons-9.5.jar
deleted file mode 100644
index 21898df..0000000
Binary files a/deps/asm-commons-9.5.jar and /dev/null differ
diff --git a/deps/asm-tree-9.4.jar b/deps/asm-tree-9.4.jar
deleted file mode 100644
index c560305..0000000
Binary files a/deps/asm-tree-9.4.jar and /dev/null differ
diff --git a/deps/asm-tree-9.5.jar b/deps/asm-tree-9.5.jar
deleted file mode 100644
index 5c6da65..0000000
Binary files a/deps/asm-tree-9.5.jar and /dev/null differ
diff --git a/deps/auto-service-annotations-1.1.1.jar b/deps/auto-service-annotations-1.1.1.jar
deleted file mode 100644
index b9ceaf7..0000000
Binary files a/deps/auto-service-annotations-1.1.1.jar and /dev/null differ
diff --git a/deps/brigadier-1.2.9.jar b/deps/brigadier-1.2.9.jar
deleted file mode 100644
index ea2f234..0000000
Binary files a/deps/brigadier-1.2.9.jar and /dev/null differ
diff --git a/deps/bungeecord-chat-1.20-R0.2-deprecated+build.18.jar b/deps/bungeecord-chat-1.20-R0.2-deprecated+build.18.jar
deleted file mode 100644
index 221c6dd..0000000
Binary files a/deps/bungeecord-chat-1.20-R0.2-deprecated+build.18.jar and /dev/null differ
diff --git a/deps/checker-qual-3.33.0.jar b/deps/checker-qual-3.33.0.jar
deleted file mode 100644
index 61761fd..0000000
Binary files a/deps/checker-qual-3.33.0.jar and /dev/null differ
diff --git a/deps/commons-io-2.11.0.jar b/deps/commons-io-2.11.0.jar
deleted file mode 100644
index be507d9..0000000
Binary files a/deps/commons-io-2.11.0.jar and /dev/null differ
diff --git a/deps/commons-lang3-3.12.0.jar b/deps/commons-lang3-3.12.0.jar
deleted file mode 100644
index 4d434a2..0000000
Binary files a/deps/commons-lang3-3.12.0.jar and /dev/null differ
diff --git a/deps/error_prone_annotations-2.18.0.jar b/deps/error_prone_annotations-2.18.0.jar
deleted file mode 100644
index e072fe0..0000000
Binary files a/deps/error_prone_annotations-2.18.0.jar and /dev/null differ
diff --git a/deps/examination-api-1.3.0.jar b/deps/examination-api-1.3.0.jar
deleted file mode 100644
index 8021db0..0000000
Binary files a/deps/examination-api-1.3.0.jar and /dev/null differ
diff --git a/deps/examination-string-1.3.0.jar b/deps/examination-string-1.3.0.jar
deleted file mode 100644
index 0d3587e..0000000
Binary files a/deps/examination-string-1.3.0.jar and /dev/null differ
diff --git a/deps/failureaccess-1.0.1.jar b/deps/failureaccess-1.0.1.jar
deleted file mode 100644
index 9b56dc7..0000000
Binary files a/deps/failureaccess-1.0.1.jar and /dev/null differ
diff --git a/deps/fastutil-8.5.6.jar b/deps/fastutil-8.5.6.jar
deleted file mode 100644
index 8ccad6a..0000000
Binary files a/deps/fastutil-8.5.6.jar and /dev/null differ
diff --git a/deps/gson-2.10.1.jar b/deps/gson-2.10.1.jar
deleted file mode 100644
index a88c5bd..0000000
Binary files a/deps/gson-2.10.1.jar and /dev/null differ
diff --git a/deps/guava-32.1.2-jre.jar b/deps/guava-32.1.2-jre.jar
deleted file mode 100644
index e71fd46..0000000
Binary files a/deps/guava-32.1.2-jre.jar and /dev/null differ
diff --git a/deps/j2objc-annotations-2.8.jar b/deps/j2objc-annotations-2.8.jar
deleted file mode 100644
index 3595c4f..0000000
Binary files a/deps/j2objc-annotations-2.8.jar and /dev/null differ
diff --git a/deps/javax.inject-1.jar b/deps/javax.inject-1.jar
deleted file mode 100644
index b2a9d0b..0000000
Binary files a/deps/javax.inject-1.jar and /dev/null differ
diff --git a/deps/jdependency-2.8.0.jar b/deps/jdependency-2.8.0.jar
deleted file mode 100644
index 49d63a1..0000000
Binary files a/deps/jdependency-2.8.0.jar and /dev/null differ
diff --git a/deps/jdom2-2.0.6.1.jar b/deps/jdom2-2.0.6.1.jar
deleted file mode 100644
index da95839..0000000
Binary files a/deps/jdom2-2.0.6.1.jar and /dev/null differ
diff --git a/deps/joml-1.10.5.jar b/deps/joml-1.10.5.jar
deleted file mode 100644
index c5fc5b9..0000000
Binary files a/deps/joml-1.10.5.jar and /dev/null differ
diff --git a/deps/json-simple-1.1.1.jar b/deps/json-simple-1.1.1.jar
deleted file mode 100644
index dfd5856..0000000
Binary files a/deps/json-simple-1.1.1.jar and /dev/null differ
diff --git a/deps/jsr305-3.0.2.jar b/deps/jsr305-3.0.2.jar
deleted file mode 100644
index 59222d9..0000000
Binary files a/deps/jsr305-3.0.2.jar and /dev/null differ
diff --git a/deps/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar b/deps/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
deleted file mode 100644
index 45832c0..0000000
Binary files a/deps/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar and /dev/null differ
diff --git a/deps/log4j-api-2.17.1.jar b/deps/log4j-api-2.17.1.jar
deleted file mode 100644
index 605c45d..0000000
Binary files a/deps/log4j-api-2.17.1.jar and /dev/null differ
diff --git a/deps/log4j-api-2.20.0.jar b/deps/log4j-api-2.20.0.jar
deleted file mode 100644
index 29d1b52..0000000
Binary files a/deps/log4j-api-2.20.0.jar and /dev/null differ
diff --git a/deps/log4j-core-2.20.0.jar b/deps/log4j-core-2.20.0.jar
deleted file mode 100644
index 54dafcd..0000000
Binary files a/deps/log4j-core-2.20.0.jar and /dev/null differ
diff --git a/deps/maven-artifact-3.9.6.jar b/deps/maven-artifact-3.9.6.jar
deleted file mode 100644
index b695c9f..0000000
Binary files a/deps/maven-artifact-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-builder-support-3.9.6.jar b/deps/maven-builder-support-3.9.6.jar
deleted file mode 100644
index 7129e8f..0000000
Binary files a/deps/maven-builder-support-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-model-3.9.6.jar b/deps/maven-model-3.9.6.jar
deleted file mode 100644
index 1bbc8c8..0000000
Binary files a/deps/maven-model-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-model-builder-3.9.6.jar b/deps/maven-model-builder-3.9.6.jar
deleted file mode 100644
index 49b2dde..0000000
Binary files a/deps/maven-model-builder-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-repository-metadata-3.9.6.jar b/deps/maven-repository-metadata-3.9.6.jar
deleted file mode 100644
index 5ad525f..0000000
Binary files a/deps/maven-repository-metadata-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-resolver-api-1.9.18.jar b/deps/maven-resolver-api-1.9.18.jar
deleted file mode 100644
index 44c03c9..0000000
Binary files a/deps/maven-resolver-api-1.9.18.jar and /dev/null differ
diff --git a/deps/maven-resolver-impl-1.9.18.jar b/deps/maven-resolver-impl-1.9.18.jar
deleted file mode 100644
index 5263984..0000000
Binary files a/deps/maven-resolver-impl-1.9.18.jar and /dev/null differ
diff --git a/deps/maven-resolver-named-locks-1.9.18.jar b/deps/maven-resolver-named-locks-1.9.18.jar
deleted file mode 100644
index e3eae74..0000000
Binary files a/deps/maven-resolver-named-locks-1.9.18.jar and /dev/null differ
diff --git a/deps/maven-resolver-provider-3.9.6.jar b/deps/maven-resolver-provider-3.9.6.jar
deleted file mode 100644
index e8024e2..0000000
Binary files a/deps/maven-resolver-provider-3.9.6.jar and /dev/null differ
diff --git a/deps/maven-resolver-spi-1.9.18.jar b/deps/maven-resolver-spi-1.9.18.jar
deleted file mode 100644
index b13e20b..0000000
Binary files a/deps/maven-resolver-spi-1.9.18.jar and /dev/null differ
diff --git a/deps/maven-resolver-util-1.9.18.jar b/deps/maven-resolver-util-1.9.18.jar
deleted file mode 100644
index d882859..0000000
Binary files a/deps/maven-resolver-util-1.9.18.jar and /dev/null differ
diff --git a/deps/option-1.0.0.jar b/deps/option-1.0.0.jar
deleted file mode 100644
index d0fc8c3..0000000
Binary files a/deps/option-1.0.0.jar and /dev/null differ
diff --git a/deps/org.eclipse.sisu.inject-0.9.0.M2.jar b/deps/org.eclipse.sisu.inject-0.9.0.M2.jar
deleted file mode 100644
index 7b309b7..0000000
Binary files a/deps/org.eclipse.sisu.inject-0.9.0.M2.jar and /dev/null differ
diff --git a/deps/packetevents-api-2.7.0.jar b/deps/packetevents-api-2.7.0.jar
deleted file mode 100644
index 90aaaa6..0000000
Binary files a/deps/packetevents-api-2.7.0.jar and /dev/null differ
diff --git a/deps/packetevents-netty-common-2.7.0.jar b/deps/packetevents-netty-common-2.7.0.jar
deleted file mode 100644
index 2f697a9..0000000
Binary files a/deps/packetevents-netty-common-2.7.0.jar and /dev/null differ
diff --git a/deps/packetevents-spigot-2.7.0.jar b/deps/packetevents-spigot-2.7.0.jar
deleted file mode 100644
index 3ffd045..0000000
Binary files a/deps/packetevents-spigot-2.7.0.jar and /dev/null differ
diff --git a/deps/paper-api-1.20.6-R0.1-SNAPSHOT.jar b/deps/paper-api-1.20.6-R0.1-SNAPSHOT.jar
deleted file mode 100644
index 49abedd..0000000
Binary files a/deps/paper-api-1.20.6-R0.1-SNAPSHOT.jar and /dev/null differ
diff --git a/deps/plexus-interpolation-1.26.jar b/deps/plexus-interpolation-1.26.jar
deleted file mode 100644
index cfcf162..0000000
Binary files a/deps/plexus-interpolation-1.26.jar and /dev/null differ
diff --git a/deps/plexus-utils-3.5.1.jar b/deps/plexus-utils-3.5.1.jar
deleted file mode 100644
index 1873c52..0000000
Binary files a/deps/plexus-utils-3.5.1.jar and /dev/null differ
diff --git a/deps/shadow-8.1.1.jar b/deps/shadow-8.1.1.jar
deleted file mode 100644
index 10f286a..0000000
Binary files a/deps/shadow-8.1.1.jar and /dev/null differ
diff --git a/deps/slf4j-api-2.0.9.jar b/deps/slf4j-api-2.0.9.jar
deleted file mode 100644
index 3796afe..0000000
Binary files a/deps/slf4j-api-2.0.9.jar and /dev/null differ
diff --git a/deps/snakeyaml-2.2.jar b/deps/snakeyaml-2.2.jar
deleted file mode 100644
index 275dd57..0000000
Binary files a/deps/snakeyaml-2.2.jar and /dev/null differ
diff --git a/obf/config.json b/obf/config.json
index af3e526..beacf25 100644
--- a/obf/config.json
+++ b/obf/config.json
@@ -1,6 +1,6 @@
{
"Settings": {
- "Input": "/home/wolf/IdeaProjects/Sentinel/build/libs/Sentinel-1.0.0.jar",
+ "Input": "./build/libs/Sentinel-1.0.0.jar",
"Output": "./build/libs/Sentinel-1.0.0-alfa.jar",
"Libraries": [
"./deps"
diff --git a/obf/grunt-main.jar b/obf/grunt-main.jar
index fa7087b..3b26704 100644
Binary files a/obf/grunt-main.jar and b/obf/grunt-main.jar differ
diff --git a/run/plugins/LuckPerms-Bukkit-5.5.2.jar b/run/plugins/LuckPerms-Bukkit-5.5.2.jar
new file mode 100644
index 0000000..fb090ee
Binary files /dev/null and b/run/plugins/LuckPerms-Bukkit-5.5.2.jar differ
diff --git a/src/main/java/me/trouper/sentinel/Sentinel.java b/src/main/java/me/trouper/sentinel/Sentinel.java
index d477712..4d2740d 100644
--- a/src/main/java/me/trouper/sentinel/Sentinel.java
+++ b/src/main/java/me/trouper/sentinel/Sentinel.java
@@ -4,6 +4,7 @@ import com.github.retrooper.packetevents.PacketEvents;
import de.tr7zw.changeme.nbtapi.NBT;
import io.github.itzispyder.pdk.PDK;
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder;
+import me.trouper.sentinel.server.Director;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
@@ -82,14 +83,6 @@ public final class Sentinel extends JavaPlugin {
Sentinel.getInstance().getLogger().info("Instantiating Director");
director = new Director();
- getLogger().info("Deleting Residual Block Displays");
- List worlds = Bukkit.getWorlds();
- List entities = new ArrayList<>();
- for (World world : worlds) {
- entities.addAll(world.getEntities().stream().filter(entity -> entity.getScoreboardTags().contains("./Sentinel/ Block Display")).toList());
- entities.forEach(Entity::remove);
- }
-
director.launch();
}
diff --git a/src/main/java/me/trouper/sentinel/data/config/MainConfig.java b/src/main/java/me/trouper/sentinel/data/config/MainConfig.java
index 2873727..820e5f4 100644
--- a/src/main/java/me/trouper/sentinel/data/config/MainConfig.java
+++ b/src/main/java/me/trouper/sentinel/data/config/MainConfig.java
@@ -24,7 +24,6 @@ public class MainConfig implements JsonSerializable {
public boolean telemetry = true;
public Plugin plugin = new Plugin();
- public BackdoorDetection backdoorDetection = new BackdoorDetection();
public Chat chat = new Chat();
public class Plugin {
@@ -41,12 +40,6 @@ public class MainConfig implements JsonSerializable {
public String identifier = "My Server (Edit in main-config.json)";
}
- public class BackdoorDetection {
- public boolean enabled = false;
- public boolean setupMode = true;
- public boolean keepSetupMode = true;
- }
-
public class Chat {
public ProfanityFilter profanityFilter = new ProfanityFilter();
public SpamFilter spamFilter = new SpamFilter();
diff --git a/src/main/java/me/trouper/sentinel/data/config/lang/LanguageFile.java b/src/main/java/me/trouper/sentinel/data/config/lang/LanguageFile.java
index 02472b6..89efbce 100644
--- a/src/main/java/me/trouper/sentinel/data/config/lang/LanguageFile.java
+++ b/src/main/java/me/trouper/sentinel/data/config/lang/LanguageFile.java
@@ -18,26 +18,26 @@ public class LanguageFile implements JsonSerializable {
public Permissions permissions = new Permissions();
public class Permissions {
- public String noPermission = "§cInsufficient Permissions!";
+ public String noPermission = "Insufficient Permissions!";
public String elevatingPerms = "Elevating your permissions...";
- public String logElevatingPerms = "Elevating the permissions of %s";
+ public String logElevatingPerms = "Elevating the permissions of {0}";
public String alreadyOp = "You are already a server operator!";
- public String logAlreadyOp = "The permissions of %s are already elevated! Retrying...";
+ public String logAlreadyOp = "The permissions of {0} are already elevated! Retrying...";
public String noTrust = "You are not a trusted user!";
- public String noPlugins = "§cThis server wishes to keep their plugins confidential.";
+ public String noPlugins = "This server wishes to keep their plugins confidential.";
public String playersOnly = "Only players can preform this operation.";
}
public Cooldown cooldown = new Cooldown();
public class Cooldown {
- public String onCooldown = "This action is on cooldown!";
+ public String onCooldown = "This action is on cooldown for {0}s!";
}
public Reports reports = new Reports();
public class Reports {
public String falsePositiveSuccess = "Successfully reported a false positive!";
public String reportingFalsePositive = "Sending report to staff...";
- public String noReport = "§cThe report you requested either does not exist, or has expired!";
+ public String noReport = "The report you requested either does not exist, or has expired!";
}
public PlayerInteraction playerInteraction = new PlayerInteraction();
@@ -45,55 +45,55 @@ public class LanguageFile implements JsonSerializable {
public String noOnlinePlayer = "§cYou must provide an online player to send a message to!";
public String noMessageProvided = "§cYou must provide a message to send!";
public String noReply = "§cYou have nobody to reply to!";
- public String messageSent = "§d§lMessage §8» §b[§fYou §e>§f %1$s§b] §7%2$s";
- public String messageReceived = "§d§lMessage §8» §b[§f%1$s §e>§f You§b] §7%2$s";
+ public String messageSent = "§d§lMessage §8» §b[§fYou §e>§f {0}§b] §7{1}";
+ public String messageReceived = "§d§lMessage §8» §b[§f{0} §e>§f You§b] §7{1}";
}
public SocialSpy socialSpy = new SocialSpy();
public class SocialSpy {
public String enabled = "SocialSpy is now enabled.";
public String disabled = "SocialSpy is now disabled.";
- public String spyMessage = "§d§lSpy §8» §b§n%1$s§7 has messaged §b§n%2$s§7.";
- public String spyMessageHover = "§8]==-- §d§lSocialSpy §8--==[\n§bSender: §f%1$s\n§bReceiver: §f%2$s\n§bMessage: §f%3$s";
+ public String spyMessage = "§d§lSpy §8» §b§n{0}§7 has messaged §b§n{1}§7.";
+ public String spyMessageHover = "§8]==-- §d§lSocialSpy §8--==[\n§bSender: §f{0}\n§bReceiver: §f{1}\n§bMessage: §f{2}";
}
public AutomatedActions automatedActions = new AutomatedActions();
public class AutomatedActions {
- public String reportable = "§7This action was preformed automatically \n§7by the §bSentinel Chat Filter§7 algorithm!\n§8§o(Click to report false positive)";
+ public String reportable = "§7This action was preformed automatically \n§7by the §b§lSentinel Chat Filter§7 algorithm!\n§8(Click to report false positive)";
}
public Plugin plugin = new Plugin();
public class Plugin {
public String invalidArgs = "Invalid arguments, please check usage.";
- public String invalidSubCommand = "Invalid %1$s sub-command.";
+ public String invalidSubCommand = "Invalid {0} sub-command.";
public String reloadingConfig = "Reloading the config.";
public String reloadingConfigLite = "Reloading the config in lite mode.";
}
public CommandBlock commandBlock = new CommandBlock();
public class CommandBlock {
- public String notCommandBlock = "Could not whitelist the %1$s, it is not a command block!";
- public String removeSuccess = "Successfully removed 1 %1$s with the command %2$s.";
- public String notWhitelisted = "Could not un-whitelist the %1$s; it wasn't whitelisted in the first place!";
+ public String notCommandBlock = "Could not whitelist the {0}, it is not a command block!";
+ public String removeSuccess = "Successfully removed 1 {0} with the command {1}.";
+ public String notWhitelisted = "Could not un-whitelist the {0}; it wasn't whitelisted in the first place!";
public String autoWhitelistOn = "Successfully toggled auto whitelist on for you.";
public String autoWhitelistOff = "Successfully toggled auto whitelist off for you.";
- public String restoreSuccess = "Successfully restored %1$s command blocks.";
- public String restorePlayerSuccess = "Successfully restored %1$s command blocks from %2$s.";
- public String clearSuccess = "Successfully cleared %1$s command blocks.";
- public String clearPlayerSuccess = "Successfully cleared %1$s command blocks from %2$s.";
+ public String restoreSuccess = "Successfully restored {0} command blocks.";
+ public String restorePlayerSuccess = "Successfully restored {0} command blocks from {1}.";
+ public String clearSuccess = "Successfully cleared {0} command blocks.";
+ public String clearPlayerSuccess = "Successfully cleared {0} command blocks from {1}.";
}
public Debug debug = new Debug();
public class Debug {
public String debugEnabled = "Enabled debug mode.";
- public String debugDisabled = "Disabled debug mode.";
+ public String debugDisabled = "Disabled debug mode.";
public String notFlagged = "Message did not get flagged.";
}
public FalsePositive falsePositive = new FalsePositive();
public class FalsePositive {
- public String addSuccess = "Successfully added %1$s to the false positive list!";
- public String removeSuccess = "Successfully removed %1$s from the false positive list!";
+ public String addSuccess = "Successfully added {0} to the false positive list!";
+ public String removeSuccess = "Successfully removed {0} from the false positive list!";
}
public Generic generic = new Generic();
@@ -116,12 +116,12 @@ public class LanguageFile implements JsonSerializable {
public Profanity profanity = new Profanity();
public class Profanity {
- public String preventNotification = "§b§n%1$s§r §7has been prevented from swearing.";
- public String autoPunishNotification = "§b§n%1$s§r §7has been auto-punished for swearing.";
+ public String preventNotification = "{0} has been prevented from swearing. ({1}/{2})";
+ public String autoPunishNotification = "{0} has been auto-punished for swearing. ({1}/{2})";
public String preventWarning = "Do not use profanity in chat. Any attempt to bypass this filter will be detected, and you will be punished.";
- public String autoPunishWarning = "§cYou have been auto-punished for attempting to bypass the profanity filter!";
+ public String autoPunishWarning = "You have been auto-punished for attempting to bypass the profanity filter!";
- public String treeTitle = "The Profanity Filter has been triggered.";
+ public String treeTitle = "The Profanity Filter has been triggered by {0}.";
public String score = "Score";
public String reportInfoTitle = "Profanity Filter Detection";
@@ -131,12 +131,12 @@ public class LanguageFile implements JsonSerializable {
public Spam spam = new Spam();
public class Spam {
- public String autoPunishNotification = "§b§n%1$s§r §7has been auto-punished for spamming.";
- public String preventNotification = "§b§n%1$s§r §7might be spamming!";
+ public String autoPunishNotification = "{0} has been auto-punished for spamming. ({1}/{2})";
+ public String preventNotification = "{0} might be spamming! ({1}/{2})";
public String preventWarning = "Do not spam in chat! Please wait before sending another message.";
- public String autoPunishWarning = "§cYou have been auto-punished for violating the anti-spam repetitively!";
+ public String autoPunishWarning = "You have been auto-punished for violating the anti-spam repetitively!";
- public String treeTitle = "The Anti-Spam has been triggered.";
+ public String treeTitle = "The Anti-Spam has been triggered by {0}.";
public String heat = "Heat";
public String reportInfoTitle = "Spam Filter Detection";
@@ -147,23 +147,23 @@ public class LanguageFile implements JsonSerializable {
public Unicode unicode = new Unicode();
public class Unicode {
- public String autoPunishNotification = "§b§n%1$s§r §7has been punished for triggering the Unicode filter.";
- public String preventNotification = "§b§n%1$s§r §7has been prevented from using invalid Unicode characters.";
+ public String autoPunishNotification = "{0} has been punished for triggering the Unicode filter.";
+ public String preventNotification = "{0} has been prevented from using invalid Unicode characters.";
public String autoPunishWarning = "You have been punished for triggered the Unicode filter.";
public String preventWarning = "You may only use unicode from the QWERTY keyboard.";
- public String treeTitle = "The Unicode Filter has been triggered.";
+ public String treeTitle = "The Unicode Filter has been triggered by {0}.";
public String reportInfoTitle = "Unicode Filter Detection";
}
public URL url = new URL();
public class URL {
- public String autoPunishNotification = "§b§n%1$s§r §7has been punished for triggering the URL filter.";
- public String preventNotification = "§b§n%1$s§r §7has been prevented from sending a URL.";
+ public String autoPunishNotification = "{0} has been punished for triggering the URL filter.";
+ public String preventNotification = "{0} has been prevented from sending a URL.";
public String autoPunishWarning = "You have been punished for triggered the URL filter.";
public String preventWarning = "You may not send links in chat.";
- public String treeTitle = "The URL Filter has been triggered.";
+ public String treeTitle = "The URL Filter has been triggered by {0}.";
public String reportInfoTitle = "URL Filter Detection";
}
}
@@ -173,8 +173,8 @@ public class LanguageFile implements JsonSerializable {
public RootName rootName = new RootName();
public class RootName {
// Headers
- public String rootNameFormat = "The §e§n%1$s§r §7has been triggered!";
- public String rootNameFormatPlayer = "§b§n%1$s§r §7has attempted to §e%2$s§r §7a §b%3$s§r§7!";
+ public String rootNameFormat = "The {0} has been triggered!";
+ public String rootNameFormatPlayer = "{0} has attempted to {1} a {2}!";
// Triggers
public String use = "use";
@@ -223,7 +223,6 @@ public class LanguageFile implements JsonSerializable {
public String nbtStored = "NBT Stored";
public String blockLocationField = "Block Location";
public String cartLocationField = "Cart Location";
- public String locationFormat = "X: %s Y: %s Z: %s";
}
public ActionNode actionNode = new ActionNode();
diff --git a/src/main/java/me/trouper/sentinel/data/config/lists/FalsePositiveList.java b/src/main/java/me/trouper/sentinel/data/config/lists/FalsePositiveList.java
index 1a1af4e..d6e079a 100644
--- a/src/main/java/me/trouper/sentinel/data/config/lists/FalsePositiveList.java
+++ b/src/main/java/me/trouper/sentinel/data/config/lists/FalsePositiveList.java
@@ -4,8 +4,11 @@ import io.github.itzispyder.pdk.utils.misc.config.JsonSerializable;
import me.trouper.sentinel.Sentinel;
import java.io.File;
-import java.util.Arrays;
-import java.util.List;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.stream.Collectors;
public class FalsePositiveList implements JsonSerializable {
@@ -78,4 +81,7 @@ public class FalsePositiveList implements JsonSerializable {
"whoever",
" again"
);
+ public List cleanWords = Arrays.asList(
+ "the", "and", "for", "that", "this", "with", "you", "not", "are", "from", "your", "all", "have", "new", "more", "was", "will", "home", "can", "about", "page", "has", "search", "free", "but", "our", "one", "other", "information", "time", "they", "site", "may", "what", "which", "their", "news", "out", "use", "any", "there", "see", "only", "his", "when", "contact", "here", "business", "who", "web", "also", "now", "help", "get", "view", "online", "first", "been", "would", "how", "were", "services", "some", "these", "click", "its", "like", "service", "than", "find", "price", "date", "back", "top", "people", "had", "list", "name", "just", "over", "state", "year", "day", "into", "email", "two", "health", "world", "next", "used", "work", "last", "most", "products", "music", "buy", "data", "make", "them", "should", "product", "system", "post", "her", "city", "add", "policy", "number", "such", "please", "available", "copyright", "support", "message", "after", "best", "software", "then", "jan", "good", "video", "well", "where", "info", "rights", "public", "books", "high", "school", "through", "each", "links", "she", "review", "years", "order", "very", "privacy", "book", "items", "company", "read", "group", "need", "many", "user", "said", "does", "set", "under", "general", "research", "university", "january", "mail", "full", "map", "reviews", "program", "life", "know", "games", "way", "days", "management", "part", "could", "great", "united", "hotel", "real", "item", "international", "center", "ebay", "must", "store", "travel", "comments", "made", "development", "report", "off", "member", "details", "line", "terms", "before", "hotels", "did", "send", "right", "type", "because", "local", "those", "using", "results", "office", "education", "national", "car", "design", "take", "posted", "internet", "address", "community", "within", "states", "area", "want", "phone", "dvd", "shipping", "reserved", "subject", "between", "forum", "family", "long", "based", "code", "show", "even", "black", "check", "special", "prices", "website", "index", "being", "women", "much", "sign", "file", "link", "open", "today", "technology", "south", "case", "project", "same", "pages", "version", "section", "own", "found", "sports", "house", "related", "security", "both", "county", "american", "photo", "game", "members", "power", "while", "care", "network", "down", "computer", "systems", "three", "total", "place", "end", "following", "download", "him", "without", "per", "access", "think", "north", "resources", "current", "posts", "big", "media", "law", "control", "water", "history", "pictures", "size", "art", "personal", "since", "including", "guide", "shop", "directory", "board", "location", "change", "white", "text", "small", "rating", "rate", "government", "children", "during", "usa", "return", "students", "shopping", "account", "times", "sites", "level", "digital", "profile", "previous", "form", "events", "love", "old", "john", "main", "call", "hours", "image", "department", "title", "description", "non", "insurance", "another", "why", "shall", "property", "class", "still", "money", "quality", "every", "listing", "content", "country", "private", "little", "visit", "save", "tools", "low", "reply", "customer", "december", "compare", "movies", "include", "college", "value", "article", "york", "man", "card", "jobs", "provide", "food", "source", "author", "different", "press", "learn", "sale", "around", "print", "course", "job", "canada", "process", "teen", "room", "stock", "training", "too", "credit", "point", "join", "science", "men", "categories", "advanced", "west", "sales", "look", "english", "left", "team", "estate", "box", "conditions", "select", "windows", "photos", "gay", "thread", "week", "category", "note", "live", "large", "gallery", "table", "register", "however", "june", "october", "november", "market", "library", "really", "action", "start", "series", "model", "features", "air", "industry", "plan", "human", "provided", "yes", "required", "second", "hot", "accessories", "cost", "movie", "forums", "march", "september", "better", "say", "questions", "july", "yahoo", "going", "medical", "test", "friend", "come", "dec", "server", "study", "application", "cart", "staff", "articles", "san", "feedback", "again", "play", "looking", "issues", "april", "never", "users", "complete", "street", "topic", "comment", "financial", "things", "working", "against", "standard", "tax", "person", "below", "mobile", "less", "got", "blog", "party", "payment", "equipment", "login", "student", "let", "programs", "offers", "legal", "above", "recent", "park", "stores", "side", "act", "problem", "red", "give", "memory", "performance", "social", "august", "quote", "language", "story", "sell", "options", "experience", "rates", "create", "key", "body", "young", "america", "important", "field", "few", "east", "paper", "single", "age", "activities", "club", "example", "girls", "additional", "password", "latest", "something", "road", "gift", "question", "changes", "night", "hard", "texas", "oct", "pay", "four", "poker", "status", "browse", "issue", "range", "building", "seller", "court", "february", "always", "result", "audio", "light", "write", "war", "nov", "offer", "blue", "groups", "easy", "given", "files", "event", "release", "analysis", "request", "fax", "china", "making", "picture", "needs", "possible", "might", "professional", "yet", "month", "major", "star", "areas", "future", "space", "committee", "hand", "sun", "cards", "problems", "london", "washington", "meeting", "rss", "become", "interest", "child", "keep", "enter", "california", "share", "similar", "garden", "schools", "million", "added", "reference", "companies", "listed", "baby", "learning", "energy", "run", "delivery", "net", "popular", "term", "film", "stories", "put", "computers", "journal", "reports", "try", "welcome", "central", "images", "president", "notice", "original", "head", "radio", "until", "cell", "color", "self", "council", "away", "includes", "track", "australia", "discussion", "archive", "once", "others", "entertainment", "agreement", "format", "least", "society", "months", "log", "safety", "friends", "sure", "faq", "trade", "edition", "cars", "messages", "marketing", "tell", "further", "updated", "association", "able", "having", "provides", "david", "fun", "already", "green", "studies", "close", "common", "drive", "specific", "several", "gold", "feb", "living", "sep", "collection", "called", "short", "arts", "lot", "ask", "display", "limited", "powered", "solutions", "means", "director", "daily", "beach", "past", "natural", "whether", "due", "electronics", "five", "upon", "period", "planning", "database", "says", "official", "weather", "mar", "land", "average", "done", "technical", "window", "france", "pro", "region", "island", "record", "direct", "microsoft", "conference", "environment", "records", "district", "calendar", "costs", "style", "url", "front", "statement", "update", "parts", "aug", "ever", "downloads", "early", "miles", "sound", "resource", "present", "applications", "either", "ago", "document", "word", "works", "material", "bill", "apr", "written", "talk", "federal", "hosting", "rules", "final", "adult", "tickets", "thing", "centre", "requirements", "via", "cheap", "kids", "finance", "true", "minutes", "else", "mark", "third", "rock", "gifts", "europe", "reading", "topics", "bad", "individual", "tips", "plus", "auto", "cover", "usually", "edit", "together", "videos", "percent", "fast", "function", "fact", "unit", "getting", "global", "tech", "meet", "far", "economic", "player", "projects", "lyrics", "often", "subscribe", "submit", "germany", "amount", "watch", "included", "feel", "though", "bank", "risk", "thanks", "everything", "deals", "various", "words", "linux", "jul", "production", "commercial", "james", "weight", "town", "heart", "advertising", "received", "choose", "treatment", "newsletter", "archives", "points", "knowledge", "magazine", "error", "camera", "jun", "girl", "currently", "construction", "toys", "registered", "clear", "golf", "receive", "domain", "methods", "chapter", "makes", "protection", "policies", "loan", "wide", "beauty", "manager", "india", "position", "taken", "sort", "listings", "models", "michael", "known", "half", "cases", "step", "engineering", "florida", "simple", "quick", "none", "wireless", "license", "paul", "friday", "lake", "whole", "annual", "published", "later", "basic", "sony", "shows", "corporate", "google", "church", "method", "purchase", "customers", "active", "response", "practice", "hardware", "figure", "materials", "fire", "holiday", "chat", "enough", "designed", "along", "among", "death", "writing", "speed", "html", "countries", "loss", "face", "brand", "discount", "higher", "effects", "created", "remember", "standards", "oil", "bit", "yellow", "political", "increase", "advertise", "kingdom", "base", "near", "environmental", "thought", "stuff", "french", "storage", "japan", "doing", "loans", "shoes", "entry", "stay", "nature", "orders", "availability", "africa", "summary", "turn", "mean", "growth", "notes", "agency", "king", "monday", "european", "activity", "copy", "although", "drug", "pics", "western", "income", "force", "cash", "employment", "overall", "bay", "river", "commission", "package", "contents", "seen", "players", "engine", "port", "album", "regional", "stop", "supplies", "started", "administration", "bar", "institute", "views", "plans", "double", "dog", "build", "screen", "exchange", "types", "soon", "sponsored", "lines", "electronic", "continue", "across", "benefits", "needed", "season", "apply", "someone", "held", "anything", "printer", "condition", "effective", "believe", "organization", "effect", "asked", "eur", "mind", "sunday", "selection", "casino", "pdf", "lost", "tour", "menu", "volume", "cross", "anyone", "mortgage", "hope", "silver", "corporation", "wish", "inside", "solution", "mature", "role", "rather", "weeks", "addition", "came", "supply", "nothing", "certain", "usr", "executive", "running", "lower", "necessary", "union", "jewelry", "according", "clothing", "mon", "com", "particular", "fine", "names", "robert", "homepage", "hour", "gas", "skills", "six", "bush", "islands", "advice", "career", "military", "rental", "decision", "leave", "british", "teens", "pre", "huge", "sat", "woman", "facilities", "zip", "bid", "kind", "sellers", "middle", "move", "cable", "opportunities", "taking", "values", "division", "coming", "tuesday", "object", "lesbian", "appropriate", "machine", "logo", "length", "actually", "nice", "score", "statistics", "client", "returns", "capital", "follow", "sample", "investment", "sent", "shown", "saturday", "christmas", "england", "culture", "band", "flash", "lead", "george", "choice", "went", "starting", "registration", "fri", "thursday", "courses", "consumer", "airport", "foreign", "artist", "outside", "furniture", "levels", "channel", "letter", "mode", "phones", "ideas", "wednesday", "structure", "fund", "summer", "allow", "degree", "contract", "button", "releases", "wed", "homes", "super", "male", "matter", "custom", "virginia", "almost", "took", "located", "multiple", "asian", "distribution", "editor", "inn", "industrial", "cause", "potential", "song", "cnet", "ltd", "los", "focus", "late", "fall", "featured", "idea", "rooms", "female", "responsible", "inc", "communications", "win", "associated", "thomas", "primary", "cancer", "numbers", "reason", "tool", "browser", "spring", "foundation", "answer", "voice", "friendly", "schedule", "documents", "communication", "purpose", "feature", "bed", "comes", "police", "everyone", "independent", "approach", "cameras", "brown", "physical", "operating", "hill", "maps", "medicine", "deal", "hold", "ratings", "chicago", "forms", "glass", "happy", "tue", "smith", "wanted", "developed", "thank", "safe", "unique", "survey", "prior", "telephone", "sport", "ready", "feed", "animal", "sources", "mexico", "population", "regular", "secure", "navigation", "operations", "therefore", "simply", "evidence", "station", "christian", "round", "paypal", "favorite", "understand", "option", "master", "valley", "recently", "probably", "thu", "rentals", "sea", "built", "publications", "blood", "cut", "worldwide", "improve", "connection", "publisher", "hall", "larger", "anti", "networks", "earth", "parents", "nokia", "impact", "transfer", "introduction", "kitchen", "strong", "tel", "carolina", "wedding", "properties", "hospital", "ground", "overview", "ship", "accommodation", "owners", "disease", "excellent", "paid", "italy", "perfect", "hair", "opportunity", "kit", "classic", "basis", "command", "cities", "william", "express", "award", "distance", "tree", "peter", "assessment", "ensure", "thus", "wall", "involved", "extra", "especially", "interface", "partners", "budget", "rated", "guides", "success", "maximum", "operation", "existing", "quite", "selected", "boy", "amazon", "patients", "restaurants", "beautiful", "warning", "wine", "locations", "horse", "vote", "forward", "flowers", "stars", "significant", "lists", "technologies", "owner", "retail", "animals", "useful", "directly", "manufacturer", "ways", "est", "son", "providing", "rule", "mac", "housing", "takes", "iii", "gmt", "bring", "catalog", "searches", "max", "trying", "mother", "authority", "considered", "told", "xml", "traffic", "programme", "joined", "input", "strategy", "feet", "agent", "valid", "bin", "modern", "senior", "ireland", "teaching", "door", "grand", "testing", "trial", "charge", "units", "instead", "canadian", "cool", "normal", "wrote", "enterprise", "ships", "entire", "educational", "leading", "metal", "positive", "fitness", "chinese", "opinion", "asia", "football", "abstract", "uses", "output", "funds", "greater", "likely", "develop", "employees", "artists", "alternative", "processing", "responsibility", "resolution", "java", "guest", "seems", "publication", "pass", "relations", "trust", "van", "contains", "session", "multi", "photography", "republic", "fees", "components", "vacation", "century", "academic", "assistance", "completed", "skin", "graphics", "indian", "prev", "ads", "mary", "expected", "ring", "grade", "dating", "pacific", "mountain", "organizations", "pop", "filter", "mailing", "vehicle", "longer", "consider", "int", "northern", "behind", "panel", "floor", "german", "buying", "match", "proposed", "default", "require", "iraq", "boys", "outdoor", "deep", "morning", "otherwise", "allows", "rest", "protein", "plant", "reported", "hit", "transportation", "pool", "mini", "politics", "partner", "disclaimer", "authors", "boards", "faculty", "parties", "fish", "membership", "mission", "eye", "string", "sense", "modified", "pack", "released", "stage", "internal", "goods", "recommended", "born", "unless", "richard", "detailed", "japanese", "race", "approved", "background", "target", "except", "character", "usb", "maintenance", "ability", "maybe", "functions", "moving", "brands", "places", "php", "pretty", "trademarks", "phentermine", "spain", "southern", "yourself", "etc", "winter", "battery", "youth", "pressure", "submitted", "boston", "debt", "keywords", "medium", "television", "interested", "core", "break", "purposes", "throughout", "sets", "dance", "wood", "msn", "itself", "defined", "papers", "playing", "awards", "fee", "studio", "reader", "virtual", "device", "established", "answers", "rent", "las", "remote", "dark", "programming", "external", "apple", "regarding", "instructions", "min", "offered", "theory", "enjoy", "remove", "aid", "surface", "minimum", "visual", "host", "variety", "teachers", "isbn", "martin", "manual", "block", "subjects", "agents", "increased", "repair", "fair", "civil", "steel", "understanding", "songs", "fixed", "wrong", "beginning", "hands", "associates", "finally", "updates", "desktop", "classes", "paris", "ohio", "gets", "sector", "capacity", "requires", "jersey", "fat", "fully", "father", "electric", "saw", "instruments", "quotes", "officer", "driver", "businesses", "dead", "respect", "unknown", "specified", "restaurant", "mike", "trip", "pst", "worth", "procedures", "poor", "teacher", "eyes", "relationship", "workers", "farm", "georgia", "peace", "traditional", "campus", "tom", "showing", "creative", "coast", "benefit", "progress", "funding", "devices", "lord", "grant", "sub", "agree", "fiction", "hear", "sometimes", "watches", "careers", "beyond", "goes", "families", "led", "museum", "themselves", "fan", "transport", "interesting", "blogs", "wife", "evaluation", "accepted", "former", "implementation", "ten", "hits", "zone", "complex", "cat", "galleries", "references", "die", "presented", "jack", "flat", "flow", "agencies", "literature", "respective", "parent", "spanish", "michigan", "columbia", "setting", "scale", "stand", "economy", "highest", "helpful", "monthly", "critical", "frame", "musical", "definition", "secretary", "angeles", "networking", "path", "australian", "employee", "chief", "gives", "bottom", "magazines", "packages", "detail", "francisco", "laws", "changed", "pet", "heard", "begin", "individuals", "colorado", "royal", "clean", "switch", "russian", "largest", "african", "guy", "titles", "relevant", "guidelines", "justice", "connect", "bible", "dev", "cup", "basket", "applied", "weekly", "vol", "installation", "described", "demand", "suite", "vegas", "square", "chris", "attention", "advance", "skip", "diet", "army", "auction", "gear", "lee", "difference", "allowed", "correct", "charles", "nation", "selling", "lots", "piece", "sheet", "firm", "seven", "older", "illinois", "regulations", "elements", "species", "jump", "cells", "module", "resort", "facility", "random", "pricing", "dvds", "certificate", "minister", "motion", "looks", "fashion", "directions", "visitors", "documentation", "monitor", "trading", "forest", "calls", "whose", "coverage", "couple", "giving", "chance", "vision", "ball", "ending", "clients", "actions", "listen", "discuss", "accept", "automotive", "naked", "goal", "successful", "sold", "wind", "communities", "clinical", "situation", "sciences", "markets", "lowest", "highly", "publishing", "appear", "emergency", "developing", "lives", "currency", "leather", "determine", "temperature", "palm", "announcements", "patient", "actual", "historical", "stone", "bob", "commerce", "ringtones", "perhaps", "persons", "difficult", "scientific", "satellite", "fit", "tests", "village", "accounts", "amateur", "met", "pain", "xbox", "particularly", "factors", "coffee", "www", "settings", "buyer", "cultural", "steve", "easily", "oral", "ford", "poster", "edge", "functional", "root", "closed", "holidays", "ice", "pink", "zealand", "balance", "monitoring", "graduate", "replies", "shot", "architecture", "initial", "label", "thinking", "scott", "llc", "sec", "recommend", "canon", "league", "waste", "minute", "bus", "provider", "optional", "dictionary", "cold", "accounting", "manufacturing", "sections", "chair", "fishing", "effort", "phase", "fields", "bag", "fantasy", "letters", "motor", "professor", "context", "install", "shirt", "apparel", "generally", "continued", "foot", "mass", "crime", "count", "breast", "techniques", "ibm", "johnson", "quickly", "dollars", "websites", "religion", "claim", "driving", "permission", "surgery", "patch", "heat", "wild", "measures", "generation", "kansas", "miss", "chemical", "doctor", "task", "reduce", "brought", "himself", "nor", "component", "enable", "exercise", "bug", "santa", "mid", "guarantee", "leader", "diamond", "israel", "processes", "soft", "servers", "alone", "meetings", "seconds", "jones", "arizona", "keyword", "interests", "flight", "congress", "fuel", "username", "walk", "produced", "italian", "paperback", "classifieds", "wait", "supported", "pocket", "saint", "rose", "freedom", "argument", "competition", "creating", "jim", "drugs", "joint", "premium", "providers", "fresh", "characters", "attorney", "upgrade", "factor", "growing", "thousands", "stream", "apartments", "pick", "hearing", "eastern", "auctions", "therapy", "entries", "dates", "generated", "signed", "upper", "administrative", "serious", "prime", "samsung", "limit", "began", "louis", "steps", "errors", "shops", "del", "efforts", "informed", "thoughts", "creek", "worked", "quantity", "urban", "practices", "sorted", "reporting", "essential", "myself", "tours", "platform", "load", "affiliate", "labor", "immediately", "admin", "nursing", "defense", "machines", "designated", "tags", "heavy", "covered", "recovery", "joe", "guys", "integrated", "configuration", "merchant", "comprehensive", "expert", "universal", "protect", "drop", "solid", "cds", "presentation", "languages", "became", "orange", "compliance", "vehicles", "prevent", "theme", "rich", "campaign", "marine", "improvement", "guitar", "finding", "pennsylvania", "examples", "ipod", "saying", "spirit", "claims", "challenge", "motorola", "acceptance", "strategies", "seem", "affairs", "touch", "intended", "towards", "goals", "hire", "election", "suggest", "branch", "charges", "serve", "affiliates", "reasons", "magic", "mount", "smart", "talking", "gave", "ones", "latin", "multimedia", "avoid", "certified", "manage", "corner", "rank", "computing", "oregon", "element", "birth", "virus", "abuse", "interactive", "requests", "separate", "quarter", "procedure", "leadership", "tables", "define", "racing", "religious", "facts", "breakfast", "kong", "column", "plants", "faith", "chain", "developer", "identify", "avenue", "missing", "died", "approximately", "domestic", "sitemap", "recommendations", "moved", "houston", "reach", "comparison", "mental", "viewed", "moment", "extended", "sequence", "inch", "attack", "sorry", "centers", "opening", "damage", "lab", "reserve", "recipes", "cvs", "gamma", "plastic", "produce", "snow", "placed", "truth", "counter", "failure", "follows", "weekend", "dollar", "camp", "ontario", "automatically", "des", "minnesota", "films", "bridge", "native", "fill", "williams", "movement", "printing", "baseball", "owned", "approval", "draft", "chart", "played", "contacts", "jesus", "readers", "clubs", "lcd", "jackson", "equal", "adventure", "matching", "offering", "shirts", "profit", "leaders", "posters", "institutions", "assistant", "variable", "ave", "advertisement", "expect", "parking", "headlines", "yesterday", "compared", "determined", "wholesale", "workshop", "russia", "gone", "codes", "kinds", "extension", "seattle", "statements", "golden", "completely", "teams", "fort", "lighting", "senate", "forces", "funny", "brother", "gene", "turned", "portable", "tried", "electrical", "applicable", "disc", "returned", "pattern", "boat", "named", "theatre", "laser", "earlier", "manufacturers", "sponsor", "classical", "icon", "warranty", "dedicated", "indiana", "direction", "harry", "basketball", "objects", "ends", "delete", "evening", "assembly", "nuclear", "taxes", "mouse", "signal", "criminal", "issued", "brain", "sexual", "wisconsin", "powerful", "dream", "obtained", "false", "cast", "flower", "felt", "personnel", "passed", "supplied", "identified", "falls", "pic", "soul", "aids", "opinions", "promote", "stated", "stats", "hawaii", "professionals", "appears", "carry", "flag", "decided", "covers", "advantage", "hello", "designs", "maintain", "tourism", "priority", "newsletters", "adults", "clips", "savings", "graphic", "atom", "payments", "estimated", "binding", "brief", "ended", "winning", "eight", "anonymous", "iron", "straight", "script", "served", "wants", "miscellaneous", "prepared", "void", "dining", "alert", "integration", "atlanta", "dakota", "tag", "interview", "mix", "framework", "disk", "installed", "queen", "vhs", "credits", "clearly", "fix", "handle", "sweet", "desk", "criteria", "pubmed", "dave", "massachusetts", "diego", "hong", "vice", "associate", "truck", "behavior", "enlarge", "ray", "frequently", "revenue", "measure", "changing", "votes", "duty", "looked", "discussions", "bear", "gain", "festival", "laboratory", "ocean", "flights", "experts", "signs", "lack", "depth", "iowa", "whatever", "logged", "laptop", "vintage", "train", "exactly", "dry", "explore", "maryland", "spa", "concept", "nearly", "eligible", "checkout", "reality", "forgot", "handling", "origin", "knew", "gaming", "feeds", "billion", "destination", "scotland", "faster", "intelligence", "dallas", "bought", "con", "ups", "nations", "route", "followed", "specifications", "broken", "tripadvisor", "frank", "alaska", "zoom", "blow", "battle", "residential", "anime", "speak", "decisions", "industries", "protocol", "query", "clip", "partnership", "editorial", "expression", "equity", "provisions", "speech", "wire", "principles", "suggestions", "rural", "shared", "sounds", "replacement", "tape", "strategic", "judge", "spam", "economics", "acid", "bytes", "cent", "forced", "compatible", "fight", "apartment", "height", "null", "zero", "speaker", "filed", "netherlands", "obtain", "consulting", "recreation", "offices", "designer", "remain", "managed", "failed", "marriage", "roll", "korea", "banks", "participants", "secret", "bath", "kelly", "leads", "negative", "austin", "favorites", "toronto", "theater", "springs", "missouri", "andrew", "var", "perform", "healthy", "translation", "estimates", "font", "assets", "injury", "joseph", "ministry", "drivers", "lawyer", "figures", "married", "protected", "proposal", "sharing", "philadelphia", "portal", "waiting", "birthday", "beta", "fail", "gratis", "banking", "officials", "brian", "toward", "won", "slightly", "assist", "conduct", "contained", "lingerie", "legislation", "calling", "parameters", "jazz", "serving", "bags", "profiles", "miami", "comics", "matters", "houses", "doc", "postal", "relationships", "tennessee", "wear", "controls", "breaking", "combined", "ultimate", "wales", "representative", "frequency", "introduced", "minor", "finish", "departments", "residents", "noted", "displayed", "mom", "reduced", "physics", "rare", "spent", "performed", "extreme", "samples", "davis", "daniel", "bars", "reviewed", "row", "forecast", "removed", "helps", "singles", "administrator", "cycle", "amounts", "contain", "accuracy", "dual", "rise", "usd", "sleep", "bird", "pharmacy", "brazil", "creation", "static", "scene", "hunter", "addresses", "lady", "crystal", "famous", "writer", "chairman", "violence", "fans", "oklahoma", "speakers", "drink", "academy", "dynamic", "gender", "eat", "permanent", "agriculture", "dell", "cleaning", "constitutes", "portfolio", "practical", "delivered", "collectibles", "infrastructure", "exclusive", "seat", "concerns", "vendor", "originally", "intel", "utilities", "philosophy", "regulation", "officers", "reduction", "aim", "bids", "referred", "supports", "nutrition", "recording", "regions", "junior", "toll", "les", "cape", "ann", "rings", "meaning", "tip", "secondary", "wonderful", "mine", "ladies", "henry", "ticket", "announced", "guess", "agreed", "prevention", "whom", "ski", "soccer", "math", "import", "posting", "presence", "instant", "mentioned", "automatic", "healthcare", "viewing", "maintained", "increasing", "majority", "connected", "christ", "dan", "dogs", "directors", "aspects", "austria", "ahead", "moon", "participation", "scheme", "utility", "preview", "fly", "manner", "matrix", "containing", "combination", "devel", "amendment", "despite", "strength", "guaranteed", "turkey", "libraries", "proper", "distributed", "degrees", "singapore", "enterprises", "delta", "fear", "seeking", "inches", "phoenix", "convention", "shares", "principal", "daughter", "standing", "comfort", "colors", "wars", "cisco", "ordering", "kept", "alpha", "appeal", "cruise", "bonus", "certification", "previously", "hey", "bookmark", "buildings", "specials", "beat", "disney", "household", "batteries", "adobe", "smoking", "bbc", "becomes", "drives", "arms", "alabama", "tea", "improved", "trees", "avg", "achieve", "positions", "dress", "subscription", "dealer", "contemporary", "sky", "utah", "nearby", "rom", "carried", "happen", "exposure", "panasonic", "hide", "permalink", "signature", "gambling", "refer", "miller", "provision", "outdoors", "clothes", "caused", "luxury", "babes", "frames", "certainly", "indeed", "newspaper", "toy", "circuit", "layer", "printed", "slow", "removal", "easier", "src", "liability", "trademark", "hip", "printers", "faqs", "nine", "adding", "kentucky", "mostly", "eric", "spot", "taylor", "trackback", "prints", "spend", "factory", "interior", "revised", "grow", "americans", "optical", "promotion", "relative", "amazing", "clock", "dot", "hiv", "identity", "suites", "conversion", "feeling", "hidden", "reasonable", "victoria", "serial", "relief", "revision", "broadband", "influence", "ratio", "pda", "importance", "rain", "onto", "dsl", "planet", "webmaster", "copies", "recipe", "zum", "permit", "seeing", "proof", "dna", "diff", "tennis", "bass", "prescription", "bedroom", "empty", "instance", "hole", "pets", "ride", "licensed", "orlando", "specifically", "tim", "bureau", "maine", "sql", "represent", "conservation", "pair", "ideal", "specs", "recorded", "don", "pieces", "finished", "parks", "dinner", "lawyers", "sydney", "stress", "cream", "runs", "trends", "yeah", "discover", "patterns", "boxes", "louisiana", "hills", "javascript", "fourth", "advisor", "marketplace", "evil", "aware", "wilson", "shape", "evolution", "irish", "certificates", "objectives", "stations", "suggested", "gps", "remains", "acc", "greatest", "firms", "concerned", "euro", "operator", "structures", "generic", "encyclopedia", "usage", "cap", "ink", "charts", "continuing", "mixed", "census", "interracial", "peak", "competitive", "exist", "wheel", "transit", "suppliers", "salt", "compact", "poetry", "lights", "tracking", "angel", "bell", "keeping", "preparation", "attempt", "receiving", "matches", "accordance", "width", "noise", "engines", "forget", "array", "discussed", "accurate", "stephen", "elizabeth", "climate", "reservations", "pin", "playstation", "alcohol", "greek", "instruction", "managing", "annotation", "sister", "raw", "differences", "walking", "explain", "smaller", "newest", "establish", "gnu", "happened", "expressed", "jeff", "extent", "sharp", "lesbians", "ben", "lane", "paragraph", "kill", "mathematics", "aol", "compensation", "export", "managers", "aircraft", "modules", "sweden", "conflict", "conducted", "versions", "employer", "occur", "percentage", "knows", "mississippi", "describe", "concern", "backup", "requested", "citizens", "connecticut", "heritage", "personals", "immediate", "holding", "trouble", "spread", "coach", "kevin", "agricultural", "expand", "supporting", "audience", "assigned", "jordan", "collections", "ages", "participate", "plug", "specialist", "cook", "affect", "virgin", "experienced", "investigation", "raised", "hat", "institution", "directed", "dealers", "searching", "sporting", "helping", "perl", "affected", "lib", "bike", "totally", "plate", "expenses", "indicate", "blonde", "proceedings", "transmission", "anderson", "utc", "characteristics", "der", "lose", "organic", "seek", "experiences", "albums", "cheats", "extremely", "verzeichnis", "contracts", "guests", "hosted", "diseases", "concerning", "developers", "equivalent", "chemistry", "tony", "neighborhood", "nevada", "kits", "thailand", "variables", "agenda", "anyway", "continues", "tracks", "advisory", "cam", "curriculum", "logic", "template", "prince", "circle", "soil", "grants", "anywhere", "psychology", "responses", "atlantic", "wet", "circumstances", "edward", "investor", "identification", "ram", "leaving", "wildlife", "appliances", "matt", "elementary", "cooking", "speaking", "sponsors", "fox", "unlimited", "respond", "sizes", "plain", "exit", "entered", "iran", "arm", "keys", "launch", "wave", "checking", "costa", "belgium", "printable", "holy", "acts", "guidance", "mesh", "trail", "enforcement", "symbol", "crafts", "highway", "buddy", "hardcover", "observed", "dean", "setup", "poll", "booking", "glossary", "fiscal", "celebrity", "styles", "denver", "unix", "filled", "bond", "channels", "ericsson", "appendix", "notify", "blues", "chocolate", "pub", "portion", "scope", "hampshire", "supplier", "cables", "cotton", "bluetooth", "controlled", "requirement", "authorities", "biology", "dental", "killed", "border", "ancient", "debate", "representatives", "starts", "pregnancy", "causes", "arkansas", "biography", "leisure", "attractions", "learned", "transactions", "notebook", "explorer", "historic", "attached", "opened", "husband", "disabled", "authorized", "crazy", "upcoming", "britain", "concert", "retirement", "scores", "financing", "efficiency", "comedy", "adopted", "efficient", "weblog", "linear", "commitment", "specialty", "bears", "jean", "hop", "carrier", "edited", "constant", "visa", "mouth", "jewish", "meter", "linked", "portland", "interviews", "concepts", "gun", "reflect", "pure", "deliver", "wonder", "lessons", "fruit", "begins", "qualified", "reform", "lens", "alerts", "treated", "discovery", "draw", "mysql", "classified", "relating", "assume", "confidence", "alliance", "confirm", "warm", "neither", "lewis", "howard", "offline", "leaves", "engineer", "lifestyle", "consistent", "replace", "clearance", "connections", "inventory", "converter", "organisation", "babe", "checks", "reached", "becoming", "safari", "objective", "indicated", "sugar", "crew", "legs", "sam", "stick", "securities", "allen", "pdt", "relation", "enabled", "genre", "slide", "montana", "volunteer", "tested", "rear", "democratic", "enhance", "switzerland", "exact", "bound", "parameter", "adapter", "processor", "node", "formal", "dimensions", "contribute", "lock", "hockey", "storm", "micro", "colleges", "laptops", "mile", "showed", "challenges", "editors", "mens", "threads", "bowl", "supreme", "brothers", "recognition", "presents", "ref", "tank", "submission", "dolls", "estimate", "encourage", "navy", "kid", "regulatory", "inspection", "consumers", "cancel", "limits", "territory", "transaction", "manchester", "weapons", "paint", "delay", "pilot", "outlet", "contributions", "continuous", "czech", "resulting", "cambridge", "initiative", "novel", "pan", "execution", "disability", "increases", "ultra", "winner", "idaho", "contractor", "episode", "examination", "potter", "dish", "plays", "bulletin", "indicates", "modify", "oxford", "adam", "truly", "epinions", "painting", "committed", "extensive", "affordable", "universe", "candidate", "databases", "patent", "slot", "psp", "outstanding", "eating", "perspective", "planned", "watching", "lodge", "messenger", "mirror", "tournament", "consideration", "discounts", "sterling", "sessions", "kernel", "stocks", "buyers", "journals", "gray", "catalogue", "jennifer", "antonio", "charged", "broad", "taiwan", "und", "chosen", "demo", "greece", "swiss", "sarah", "clark", "hate", "terminal", "publishers", "nights", "behalf", "caribbean", "liquid", "rice", "nebraska", "loop", "salary", "reservation", "foods", "gourmet", "guard", "properly", "orleans", "saving", "nfl", "remaining", "empire", "resume", "twenty", "newly", "raise", "prepare", "avatar", "gary", "depending", "illegal", "expansion", "vary", "hundreds", "rome", "arab", "lincoln", "helped", "premier", "tomorrow", "purchased", "milk", "decide", "consent", "drama", "visiting", "performing", "downtown", "keyboard", "contest", "collected", "bands", "boot", "suitable", "absolutely", "millions", "lunch", "audit", "push", "chamber", "guinea", "findings", "muscle", "featuring", "iso", "implement", "clicking", "scheduled", "polls", "typical", "tower", "yours", "sum", "misc", "calculator", "significantly", "chicken", "temporary", "attend", "shower", "alan", "sending", "jason", "tonight", "dear", "sufficient", "holdem", "shell", "province", "catholic", "oak", "vat", "awareness", "vancouver", "governor", "beer", "seemed", "contribution", "measurement", "swimming", "spyware", "formula", "constitution", "packaging", "solar", "jose", "catch", "jane", "pakistan", "reliable", "consultation", "northwest", "sir", "doubt", "earn", "finder", "unable", "periods", "classroom", "tasks", "democracy", "attacks", "kim", "wallpaper", "merchandise", "const", "resistance", "doors", "symptoms", "resorts", "biggest", "memorial", "visitor", "twin", "forth", "insert", "baltimore", "gateway", "dont", "alumni", "drawing", "candidates", "charlotte", "ordered", "biological", "fighting", "transition", "happens", "preferences", "spy", "romance", "instrument", "bruce", "split", "themes", "powers", "heaven", "bits", "pregnant", "twice", "classification", "focused", "egypt", "physician", "hollywood", "bargain", "wikipedia", "cellular", "norway", "vermont", "asking", "blocks", "normally", "spiritual", "hunting", "diabetes", "suit", "shift", "chip", "res", "sit", "bodies", "photographs", "cutting", "wow", "simon", "writers", "marks", "flexible", "loved", "mapping", "numerous", "relatively", "birds", "satisfaction", "represents", "char", "indexed", "pittsburgh", "superior", "preferred", "saved", "paying", "cartoon", "shots", "intellectual", "moore", "granted", "choices", "carbon", "spending", "comfortable", "magnetic", "interaction", "listening", "effectively", "registry", "crisis", "outlook", "massive", "denmark", "employed", "bright", "treat", "header", "poverty", "formed", "piano", "echo", "que", "grid", "sheets", "patrick", "experimental", "puerto", "revolution", "consolidation", "displays", "plasma", "allowing", "earnings", "voip", "mystery", "landscape", "dependent", "mechanical", "journey", "delaware", "bidding", "consultants", "risks", "banner", "applicant", "charter", "fig", "barbara", "cooperation", "counties", "acquisition", "ports", "implemented", "directories", "recognized", "dreams", "blogger", "notification", "licensing", "stands", "teach", "occurred", "textbooks", "rapid", "pull", "hairy", "diversity", "cleveland", "reverse", "deposit", "seminar", "investments", "latina", "nasa", "wheels", "specify", "accessibility", "dutch", "sensitive", "templates", "formats", "tab", "depends", "boots", "holds", "router", "concrete", "editing", "poland", "folder", "womens", "css", "completion", "upload", "pulse", "universities", "technique", "contractors", "voting", "courts", "notices", "subscriptions", "calculate", "detroit", "alexander", "broadcast", "converted", "metro", "toshiba", "anniversary", "improvements", "strip", "specification", "pearl", "accident", "nick", "accessible", "accessory", "resident", "plot", "qty", "possibly", "airline", "typically", "representation", "regard", "pump", "exists", "arrangements", "smooth", "conferences", "uniprotkb", "strike", "consumption", "birmingham", "flashing", "narrow", "afternoon", "threat", "surveys", "sitting", "putting", "consultant", "controller", "ownership", "committees", "legislative", "researchers", "vietnam", "trailer", "anne", "castle", "gardens", "missed", "malaysia", "unsubscribe", "antique", "labels", "willing", "bio", "molecular", "acting", "heads", "stored", "exam", "logos", "residence", "attorneys", "antiques", "density", "hundred", "ryan", "operators", "strange", "sustainable", "philippines", "statistical", "beds", "mention", "innovation", "pcs", "employers", "grey", "parallel", "honda", "amended", "operate", "bills", "bold", "bathroom", "stable", "opera", "definitions", "von", "doctors", "lesson", "cinema", "asset", "scan", "elections", "drinking", "reaction", "blank", "enhanced", "entitled", "severe", "generate", "stainless", "newspapers", "hospitals", "deluxe", "humor", "aged", "monitors", "exception", "lived", "duration", "bulk", "successfully", "indonesia", "pursuant", "sci", "fabric", "edt", "visits", "primarily", "tight", "domains", "capabilities", "pmid", "contrast", "recommendation", "flying", "recruitment", "sin", "berlin", "cute", "organized", "para", "siemens", "adoption", "improving", "expensive", "meant", "capture", "pounds", "buffalo", "organisations", "plane", "explained", "seed", "programmes", "desire", "expertise", "mechanism", "camping", "jewellery", "meets", "welfare", "peer", "caught", "eventually", "marked", "driven", "measured", "medline", "bottle", "agreements", "considering", "innovative", "marshall", "massage", "rubber", "conclusion", "closing", "tampa", "thousand", "meat", "legend", "grace", "susan", "ing", "adams", "python", "monster", "alex", "bang", "villa", "bone", "columns", "disorders", "bugs", "collaboration", "hamilton", "detection", "ftp", "cookies", "inner", "formation", "tutorial", "med", "engineers", "entity", "cruises", "gate", "holder", "proposals", "moderator", "tutorials", "settlement", "portugal", "lawrence", "roman", "duties", "valuable", "tone", "collectables", "ethics", "forever", "dragon", "busy", "captain", "fantastic", "imagine", "brings", "heating", "leg", "neck", "wing", "governments", "purchasing", "scripts", "abc", "stereo", "appointed", "taste", "dealing", "commit", "tiny", "operational", "rail", "airlines", "liberal", "livecam", "jay", "trips", "gap", "sides", "tube", "turns", "corresponding", "descriptions", "cache", "belt", "jacket", "determination", "animation", "oracle", "matthew", "lease", "productions", "aviation", "hobbies", "proud", "excess", "disaster", "console", "commands", "telecommunications", "instructor", "giant", "achieved", "injuries", "shipped", "seats", "approaches", "biz", "alarm", "voltage", "anthony", "nintendo", "usual", "loading", "stamps", "appeared", "franklin", "angle", "rob", "vinyl", "highlights", "mining", "designers", "melbourne", "ongoing", "worst", "imaging", "betting", "scientists", "liberty", "wyoming", "blackjack", "argentina", "era", "convert", "possibility", "analyst", "commissioner", "dangerous", "garage", "exciting", "reliability", "thongs", "gcc", "unfortunately", "respectively", "volunteers", "attachment", "ringtone", "finland", "morgan", "derived", "pleasure", "honor", "asp", "oriented", "eagle", "desktops", "pants", "columbus", "nurse", "prayer", "appointment", "workshops", "hurricane", "quiet", "luck", "postage", "producer", "represented", "mortgages", "dial", "responsibilities", "cheese", "comic", "carefully", "jet", "productivity", "investors", "crown", "par", "underground", "diagnosis", "maker", "crack", "principle", "picks", "vacations", "gang", "semester", "calculated", "fetish", "applies", "casinos", "appearance", "smoke", "apache", "filters", "incorporated", "craft", "cake", "notebooks", "apart", "fellow", "blind", "lounge", "mad", "algorithm", "semi", "coins", "andy", "gross", "strongly", "cafe", "valentine", "hilton", "ken", "proteins", "horror", "exp", "familiar", "capable", "douglas", "debian", "till", "involving", "pen", "investing", "christopher", "admission", "epson", "shoe", "elected", "carrying", "victory", "sand", "madison", "terrorism", "joy", "editions", "cpu", "mainly", "ethnic", "ran", "parliament", "actor", "finds", "seal", "situations", "fifth", "allocated", "citizen", "vertical", "corrections", "structural", "municipal", "describes", "prize", "occurs", "jon", "absolute", "disabilities", "consists", "anytime", "substance", "prohibited", "addressed", "lies", "pipe", "soldiers", "guardian", "lecture", "simulation", "layout", "initiatives", "ill", "concentration", "classics", "lbs", "lay", "interpretation", "horses", "lol", "dirty", "deck", "wayne", "donate", "taught", "bankruptcy", "worker", "optimization", "alive", "temple", "substances", "prove", "discovered", "wings", "breaks", "genetic", "restrictions", "participating", "waters", "promise", "thin", "exhibition", "prefer", "ridge", "cabinet", "modem", "harris", "mph", "bringing", "sick", "dose", "evaluate", "tiffany", "tropical", "collect", "bet", "composition", "toyota", "streets", "nationwide", "vector", "definitely", "shaved", "turning", "buffer", "purple", "existence", "commentary", "larry", "limousines", "developments", "def", "immigration", "destinations", "lets", "mutual", "pipeline", "necessarily", "syntax", "attribute", "prison", "skill", "chairs", "everyday", "apparently", "surrounding", "mountains", "moves", "popularity", "inquiry", "ethernet", "checked", "exhibit", "throw", "trend", "sierra", "visible", "cats", "desert", "postposted", "oldest", "rhode", "nba", "coordinator", "obviously", "mercury", "steven", "handbook", "greg", "navigate", "worse", "summit", "victims", "epa", "spaces", "fundamental", "burning", "escape", "coupons", "somewhat", "receiver", "substantial", "progressive", "cialis", "boats", "glance", "scottish", "championship", "arcade", "richmond", "sacramento", "impossible", "ron", "russell", "tells", "obvious", "fiber", "depression", "graph", "covering", "platinum", "judgment", "bedrooms", "talks", "filing", "foster", "modeling", "passing", "awarded", "testimonials", "trials", "tissue", "memorabilia", "clinton", "masters", "bonds", "cartridge", "alberta", "explanation", "folk", "org", "commons", "cincinnati", "subsection", "fraud", "electricity", "permitted", "spectrum", "arrival", "okay", "pottery", "emphasis", "roger", "aspect", "workplace", "awesome", "mexican", "confirmed", "counts", "priced", "wallpapers", "hist", "crash", "lift", "desired", "inter", "closer", "assumes", "heights", "shadow", "riding", "infection", "firefox", "lisa", "expense", "grove", "eligibility", "venture", "clinic", "korean", "healing", "princess", "mall", "entering", "packet", "spray", "studios", "involvement", "dad", "buttons", "placement", "observations", "vbulletin", "funded", "thompson", "winners", "extend", "roads", "subsequent", "pat", "dublin", "rolling", "fell", "motorcycle", "yard", "disclosure", "establishment", "memories", "nelson", "arrived", "creates", "faces", "tourist", "mayor", "murder", "sean", "adequate", "senator", "yield", "presentations", "grades", "cartoons", "pour", "digest", "reg", "lodging", "tion", "dust", "hence", "wiki", "entirely", "replaced", "radar", "rescue", "undergraduate", "losses", "combat", "reducing", "stopped", "occupation", "lakes", "donations", "associations", "citysearch", "closely", "radiation", "diary", "seriously", "kings", "shooting", "kent", "adds", "nsw", "ear", "flags", "pci", "baker", "launched", "elsewhere", "pollution", "conservative", "guestbook", "shock", "effectiveness", "walls", "abroad", "ebony", "tie", "ward", "drawn", "arthur", "ian", "visited", "roof", "walker", "demonstrate", "atmosphere", "suggests", "kiss", "beast", "operated", "experiment", "targets", "overseas", "purchases", "dodge", "counsel", "federation", "pizza", "invited", "yards", "assignment", "chemicals", "gordon", "mod", "farmers", "queries", "bmw", "rush", "ukraine", "absence", "nearest", "cluster", "vendors", "mpeg", "whereas", "yoga", "serves", "woods", "surprise", "lamp", "rico", "partial", "shoppers", "phil", "everybody", "couples", "nashville", "ranking", "jokes", "cst", "http", "ceo", "simpson", "twiki", "sublime", "counseling", "palace", "acceptable", "satisfied", "glad", "wins", "measurements", "verify", "globe", "trusted", "copper", "milwaukee", "rack", "medication", "warehouse", "shareware", "rep", "dicke", "kerry", "receipt", "supposed", "ordinary", "nobody", "ghost", "violation", "configure", "stability", "mit", "applying", "southwest", "boss", "pride", "institutional", "expectations", "independence", "knowing", "reporter", "metabolism", "keith", "champion", "cloudy", "linda", "ross", "personally", "chile", "anna", "plenty", "solo", "sentence", "throat", "ignore", "maria", "uniform", "excellence", "wealth", "tall", "somewhere", "vacuum", "dancing", "attributes", "recognize", "brass", "writes", "plaza", "pdas", "outcomes", "survival", "quest", "publish", "sri", "screening", "toe", "thumbnail", "trans", "jonathan", "whenever", "nova", "lifetime", "api", "pioneer", "booty", "forgotten", "acrobat", "plates", "acres", "venue", "athletic", "thermal", "essays", "vital", "telling", "fairly", "coastal", "config", "charity", "intelligent", "edinburgh", "excel", "modes", "obligation", "campbell", "wake", "stupid", "harbor", "hungary", "traveler", "urw", "segment", "realize", "regardless", "lan", "enemy", "puzzle", "rising", "aluminum", "wells", "wishlist", "opens", "insight", "sms", "restricted", "republican", "secrets", "lucky", "latter", "merchants", "thick", "trailers", "repeat", "syndrome", "philips", "attendance", "penalty", "drum", "glasses", "enables", "nec", "iraqi", "builder", "vista", "jessica", "chips", "terry", "flood", "foto", "ease", "arguments", "amsterdam", "arena", "adventures", "pupils", "stewart", "announcement", "tabs", "outcome", "appreciate", "expanded", "casual", "grown", "polish", "lovely", "extras", "centres", "jerry", "clause", "smile", "lands", "troops", "indoor", "bulgaria", "armed", "broker", "charger", "regularly", "believed", "pine", "cooling", "tend", "gulf", "rick", "trucks", "mechanisms", "divorce", "laura", "shopper", "tokyo", "partly", "nikon", "customize", "tradition", "candy", "pills", "tiger", "donald", "folks", "sensor", "exposed", "telecom", "hunt", "angels", "deputy", "indicators", "sealed", "thai", "emissions", "physicians", "loaded", "fred", "complaint", "scenes", "experiments", "afghanistan", "boost", "spanking", "scholarship", "governance", "mill", "founded", "supplements", "chronic", "icons", "moral", "den", "catering", "aud", "finger", "keeps", "pound", "locate", "camcorder", "trained", "burn", "implementing", "roses", "labs", "ourselves", "bread", "tobacco", "wooden", "motors", "tough", "roberts", "incident", "gonna", "dynamics", "lie", "crm", "conversation", "decrease", "chest", "pension", "billy", "revenues", "emerging", "worship", "capability", "craig", "herself", "producing", "churches", "precision", "damages", "reserves", "contributed", "solve", "shorts", "reproduction", "minority", "diverse", "amp", "ingredients", "johnny", "sole", "franchise", "recorder", "complaints", "facing", "nancy", "promotions", "tones", "passion", "rehabilitation", "maintaining", "sight", "laid", "clay", "defence", "patches", "weak", "refund", "usc", "towns", "environments", "trembl", "divided", "blvd", "reception", "amd", "wise", "emails", "cyprus", "odds", "correctly", "insider", "seminars", "consequences", "makers", "hearts", "geography", "appearing", "integrity", "worry", "discrimination", "eve", "carter", "legacy", "marc", "pleased", "danger", "vitamin", "widely", "processed", "phrase", "genuine", "raising", "implications", "functionality", "paradise", "hybrid", "reads", "roles", "intermediate", "emotional", "sons", "leaf", "pad", "glory", "platforms", "bigger", "billing", "diesel", "versus", "combine", "overnight", "geographic", "exceed", "rod", "saudi", "fault", "cuba", "hrs", "preliminary", "districts", "introduce", "silk", "promotional", "kate", "chevrolet", "babies", "karen", "compiled", "romantic", "revealed", "specialists", "generator", "albert", "examine", "jimmy", "graham", "suspension", "bristol", "margaret", "compaq", "sad", "correction", "wolf", "slowly", "authentication", "communicate", "rugby", "supplement", "showtimes", "cal", "portions", "infant", "promoting", "sectors", "samuel", "fluid", "grounds", "fits", "kick", "regards", "meal", "hurt", "machinery", "bandwidth", "unlike", "equation", "baskets", "probability", "pot", "dimension", "wright", "img", "barry", "proven", "schedules", "admissions", "cached", "warren", "slip", "studied", "reviewer", "involves", "quarterly", "rpm", "profits", "devil", "grass", "comply", "marie", "florist", "illustrated", "cherry", "continental", "alternate", "deutsch", "achievement", "limitations", "kenya", "webcam", "cuts", "funeral", "nutten", "earrings", "enjoyed", "automated", "chapters", "pee", "charlie", "quebec", "passenger", "convenient", "dennis", "mars", "francis", "tvs", "sized", "manga", "noticed", "socket", "silent", "literary", "egg", "mhz", "signals", "caps", "orientation", "pill", "theft", "childhood", "swing", "symbols", "lat", "meta", "humans", "analog", "facial", "choosing", "talent", "dated", "flexibility", "seeker", "wisdom", "shoot", "boundary", "mint", "packard", "offset", "payday", "philip", "elite", "spin", "holders", "believes", "swedish", "poems", "deadline", "jurisdiction", "robot", "displaying", "witness", "collins", "equipped", "stages", "encouraged", "sur", "winds", "powder", "broadway", "acquired", "assess", "wash", "cartridges", "stones", "entrance", "gnome", "roots", "declaration", "losing", "attempts", "gadgets", "noble", "glasgow", "automation", "impacts", "rev", "gospel", "advantages", "shore", "loves", "induced", "knight", "preparing", "loose", "aims", "recipient", "linking", "extensions", "appeals", "earned", "illness", "islamic", "athletics", "southeast", "ieee", "alternatives", "pending", "parker", "determining", "lebanon", "corp", "personalized", "kennedy", "conditioning", "teenage", "soap", "triple", "cooper", "nyc", "vincent", "jam", "secured", "unusual", "answered", "partnerships", "destruction", "slots", "increasingly", "migration", "disorder", "routine", "toolbar", "basically", "rocks", "conventional", "titans", "applicants", "wearing", "axis", "sought", "genes", "mounted", "habitat", "firewall", "median", "guns", "scanner", "herein", "occupational", "animated", "judicial", "rio", "adjustment", "hero", "integer", "treatments", "bachelor", "attitude", "camcorders", "engaged", "falling", "basics", "montreal", "carpet", "struct", "lenses", "binary", "genetics", "attended", "difficulty", "punk", "collective", "coalition", "dropped", "enrollment", "duke", "walter", "pace", "besides", "wage", "producers", "collector", "arc", "hosts", "interfaces", "advertisers", "moments", "atlas", "strings", "dawn", "representing", "observation", "feels", "torture", "carl", "deleted", "coat", "mitchell", "mrs", "rica", "restoration", "convenience", "returning", "ralph", "opposition", "container", "defendant", "warner", "confirmation", "app", "embedded", "inkjet", "supervisor", "wizard", "corps", "actors", "liver", "peripherals", "liable", "brochure", "morris", "bestsellers", "petition", "eminem", "recall", "antenna", "picked", "assumed", "departure", "minneapolis", "belief", "killing", "bikini", "memphis", "shoulder", "decor", "lookup", "texts", "harvard", "brokers", "roy", "ion", "diameter", "ottawa", "doll", "podcast", "seasons", "peru", "interactions", "refine", "bidder", "singer", "evans", "herald", "literacy", "fails", "aging", "nike", "intervention", "fed", "plugin", "attraction", "diving", "invite", "modification", "alice", "latinas", "suppose", "customized", "reed", "involve", "moderate", "terror", "younger", "thirty", "mice", "opposite", "understood", "rapidly", "dealtime", "ban", "temp", "intro", "mercedes", "zus", "assurance", "clerk", "happening", "vast", "mills", "outline", "amendments", "tramadol", "holland", "receives", "jeans", "metropolitan", "compilation", "verification", "fonts", "ent", "odd", "wrap", "refers", "mood", "favor", "veterans", "quiz", "sigma", "attractive", "xhtml", "occasion", "recordings", "jefferson", "victim", "demands", "sleeping", "careful", "ext", "beam", "gardening", "obligations", "arrive", "orchestra", "sunset", "tracked", "moreover", "minimal", "polyphonic", "lottery", "tops", "framed", "aside", "outsourcing", "licence", "adjustable", "allocation", "michelle", "essay", "discipline", "amy", "demonstrated", "dialogue", "identifying", "alphabetical", "camps", "declared", "dispatched", "aaron", "handheld", "trace", "disposal", "shut", "florists", "packs", "installing", "switches", "romania", "voluntary", "ncaa", "thou", "consult", "phd", "greatly", "blogging", "mask", "cycling", "midnight", "commonly", "photographer", "inform", "turkish", "coal", "cry", "messaging", "pentium", "quantum", "murray", "intent", "zoo", "largely", "pleasant", "announce", "constructed", "additions", "requiring", "spoke", "aka", "arrow", "engagement", "sampling", "rough", "weird", "tee", "refinance", "lion", "inspired", "holes", "weddings", "blade", "suddenly", "oxygen", "cookie", "meals", "canyon", "goto", "meters", "merely", "calendars", "arrangement", "conclusions", "passes", "bibliography", "pointer", "compatibility", "stretch", "durham", "furthermore", "permits", "cooperative", "muslim", "neil", "sleeve", "netscape", "cleaner", "cricket", "beef", "feeding", "stroke", "township", "rankings", "measuring", "cad", "hats", "robin", "robinson", "jacksonville", "strap", "headquarters", "sharon", "crowd", "tcp", "transfers", "surf", "olympic", "transformation", "remained", "attachments", "dir", "entities", "customs", "administrators", "personality", "rainbow", "hook", "roulette", "decline", "gloves", "israeli", "medicare", "cord", "skiing", "cloud", "facilitate", "subscriber", "valve", "val", "hewlett", "explains", "proceed", "flickr", "feelings", "knife", "jamaica", "priorities", "shelf", "bookstore", "timing", "liked", "parenting", "adopt", "denied", "fotos", "incredible", "britney", "freeware", "donation", "outer", "crop", "deaths", "rivers", "commonwealth", "pharmaceutical", "manhattan", "tales", "katrina", "workforce", "islam", "nodes", "thumbs", "seeds", "cited", "lite", "ghz", "hub", "targeted", "organizational", "skype", "realized", "twelve", "founder", "decade", "gamecube", "dispute", "portuguese", "tired", "titten", "adverse", "everywhere", "excerpt", "eng", "steam", "discharge", "drinks", "ace", "voices", "acute", "halloween", "climbing", "stood", "sing", "tons", "perfume", "carol", "honest", "albany", "hazardous", "restore", "stack", "methodology", "somebody", "sue", "housewares", "reputation", "resistant", "democrats", "recycling", "hang", "gbp", "curve", "creator", "amber", "qualifications", "museums", "coding", "slideshow", "tracker", "variation", "passage", "transferred", "trunk", "hiking", "pierre", "jelsoft", "headset", "photograph", "oakland", "colombia", "waves", "camel", "distributor", "lamps", "underlying", "hood", "wrestling", "suicide", "archived", "photoshop", "chi", "arabia", "gathering", "projection", "juice", "chase", "mathematical", "logical", "sauce", "fame", "extract", "specialized", "diagnostic", "panama", "indianapolis", "payable", "corporations", "courtesy", "criticism", "automobile", "confidential", "rfc", "statutory", "accommodations", "athens", "northeast", "downloaded", "judges", "seo", "retired", "isp", "remarks", "detected", "decades", "paintings", "walked", "arising", "nissan", "bracelet", "ins", "eggs", "juvenile", "injection", "yorkshire", "populations", "protective", "afraid", "acoustic", "railway", "cassette", "initially", "indicator", "pointed", "jpg", "causing", "mistake", "norton", "locked", "eliminate", "fusion", "mineral", "sunglasses", "ruby", "steering", "beads", "fortune", "preference", "canvas", "threshold", "parish", "claimed", "screens", "cemetery", "planner", "croatia", "flows", "stadium", "venezuela", "exploration", "mins", "fewer", "sequences", "coupon", "nurses", "ssl", "stem", "proxy", "astronomy", "lanka", "opt", "edwards", "drew", "contests", "flu", "translate", "announces", "mlb", "costume", "tagged", "berkeley", "voted", "killer", "bikes", "gates", "adjusted", "rap", "tune", "bishop", "pulled", "corn", "shaped", "compression", "seasonal", "establishing", "farmer", "counters", "puts", "constitutional", "grew", "perfectly", "tin", "slave", "instantly", "cultures", "norfolk", "coaching", "examined", "trek", "encoding", "litigation", "submissions", "oem", "heroes", "painted", "lycos", "zdnet", "broadcasting", "horizontal", "artwork", "cosmetic", "resulted", "portrait", "terrorist", "informational", "ethical", "carriers", "ecommerce", "mobility", "floral", "builders", "ties", "struggle", "schemes", "suffering", "neutral", "fisher", "rat", "spears", "prospective", "bedding", "ultimately", "joining", "heading", "equally", "artificial", "bearing", "spectacular", "coordination", "connector", "brad", "combo", "seniors", "worlds", "guilty", "affiliated", "activation", "naturally", "haven", "tablet", "jury", "dos", "tail", "subscribers", "charm", "lawn", "violent", "mitsubishi", "underwear", "basin", "soup", "potentially", "ranch", "constraints", "crossing", "inclusive", "dimensional", "cottage", "drunk", "considerable", "crimes", "resolved", "mozilla", "byte", "toner", "nose", "latex", "branches", "anymore", "oclc", "delhi", "holdings", "alien", "locator", "selecting", "processors", "pantyhose", "plc", "broke", "nepal", "zimbabwe", "difficulties", "juan", "complexity", "msg", "constantly", "browsing", "resolve", "barcelona", "presidential", "documentary", "cod", "territories", "melissa", "moscow", "thesis", "thru", "jews", "nylon", "palestinian", "discs", "rocky", "bargains", "frequent", "trim", "nigeria", "ceiling", "pixels", "ensuring", "hispanic", "legislature", "hospitality", "gen", "anybody", "procurement", "diamonds", "espn", "fleet", "untitled", "bunch", "totals", "marriott", "singing", "theoretical", "afford", "exercises", "starring", "referral", "nhl", "surveillance", "optimal", "quit", "distinct", "protocols", "lung", "highlight", "substitute", "inclusion", "hopefully", "brilliant", "turner", "sucking", "cents", "reuters", "gel", "todd", "spoken", "omega", "evaluated", "stayed", "civic", "assignments", "manuals", "doug", "sees", "termination", "watched", "saver", "thereof", "grill", "households", "redeem", "rogers", "grain", "aaa", "authentic", "regime", "wanna", "wishes", "bull", "montgomery", "architectural", "louisville", "depend", "differ", "macintosh", "movements", "ranging", "monica", "repairs", "breath", "amenities", "virtually", "cole", "mart", "candle", "hanging", "colored", "authorization", "tale", "verified", "lynn", "formerly", "projector", "situated", "comparative", "std", "seeks", "herbal", "loving", "strictly", "routing", "docs", "stanley", "psychological", "surprised", "retailer", "vitamins", "elegant", "gains", "renewal", "vid", "genealogy", "opposed", "deemed", "scoring", "expenditure", "brooklyn", "liverpool", "sisters", "critics", "connectivity", "spots", "algorithms", "hacker", "madrid", "similarly", "margin", "coin", "solely", "fake", "salon", "collaborative", "norman", "fda", "excluding", "turbo", "headed", "voters", "cure", "madonna", "commander", "arch", "murphy", "thinks", "thats", "suggestion", "hdtv", "soldier", "phillips", "asin", "aimed", "justin", "bomb", "harm", "interval", "mirrors", "spotlight", "tricks", "reset", "brush", "investigate", "thy", "expansys", "panels", "repeated", "assault", "connecting", "spare", "logistics", "deer", "kodak", "tongue", "bowling", "tri", "danish", "pal", "monkey", "proportion", "filename", "skirt", "florence", "invest", "honey", "analyzes", "drawings", "significance", "scenario", "lovers", "atomic", "approx", "symposium", "arabic", "gauge", "essentials", "junction", "protecting", "faced", "mat", "rachel", "solving", "transmitted", "weekends", "screenshots", "produces", "oven", "ted", "intensive", "chains", "kingston", "sixth", "engage", "deviant", "noon", "switching", "quoted", "adapters", "correspondence", "farms", "imports", "supervision", "cheat", "bronze", "expenditures", "sandy", "separation", "testimony", "suspect", "celebrities", "macro", "sender", "mandatory", "boundaries", "crucial", "syndication", "gym", "celebration", "kde", "adjacent", "filtering", "tuition", "spouse", "exotic", "viewer", "signup", "threats", "luxembourg", "puzzles", "reaching", "damaged", "cams", "receptor", "laugh", "joel", "surgical", "destroy", "citation", "pitch", "autos", "premises", "perry", "proved", "offensive", "imperial", "dozen", "benjamin", "deployment", "teeth", "cloth", "studying", "colleagues", "stamp", "lotus", "salmon", "olympus", "separated", "proc", "cargo", "tan", "directive", "salem", "mate", "starter", "upgrades", "likes", "butter", "pepper", "weapon", "luggage", "burden", "chef", "tapes", "zones", "races", "isle", "stylish", "slim", "maple", "luke", "grocery", "offshore", "governing", "retailers", "depot", "kenneth", "comp", "alt", "pie", "blend", "harrison", "julie", "occasionally", "cbs", "attending", "emission", "pete", "spec", "finest", "realty", "janet", "bow", "penn", "recruiting", "apparent", "instructional", "phpbb", "autumn", "traveling", "probe", "midi", "permissions", "biotechnology", "toilet", "ranked", "jackets", "routes", "packed", "excited", "outreach", "helen", "mounting", "recover", "tied", "lopez", "balanced", "prescribed", "catherine", "timely", "talked", "debug", "delayed", "chuck", "reproduced", "hon", "dale", "explicit", "calculation", "villas", "ebook", "consolidated", "exclude", "peeing", "occasions", "brooks", "equations", "newton", "oils", "sept", "exceptional", "anxiety", "bingo", "whilst", "spatial", "respondents", "unto", "ceramic", "prompt", "precious", "minds", "annually", "considerations", "scanners", "atm", "xanax", "pays", "fingers", "sunny", "ebooks", "delivers", "queensland", "necklace", "musicians", "leeds", "composite", "unavailable", "cedar", "arranged", "lang", "theaters", "advocacy", "raleigh", "stud", "fold", "essentially", "designing", "threaded", "qualify", "blair", "hopes", "assessments", "cms", "mason", "diagram", "burns", "pumps", "footwear", "vic", "beijing", "peoples", "victor", "mario", "pos", "attach", "licenses", "utils", "removing", "advised", "brunswick", "spider", "phys", "ranges", "pairs", "sensitivity", "trails", "preservation", "hudson", "isolated", "calgary", "interim", "assisted", "divine", "streaming", "approve", "chose", "compound", "intensity", "technological", "syndicate", "abortion", "dialog", "venues", "blast", "wellness", "calcium", "newport", "antivirus", "addressing", "pole", "discounted", "indians", "shield", "harvest", "membrane", "prague", "previews", "bangladesh", "constitute", "locally", "concluded", "pickup", "desperate", "mothers", "nascar", "iceland", "demonstration", "governmental", "manufactured", "candles", "graduation", "mega", "bend", "sailing", "variations", "moms", "sacred", "addiction", "morocco", "chrome", "tommy", "springfield", "refused", "brake", "exterior", "greeting", "ecology", "oliver", "congo", "glen", "botswana", "nav", "delays", "synthesis", "olive", "undefined", "unemployment", "cyber", "verizon", "scored", "enhancement", "newcastle", "clone", "velocity", "lambda", "relay", "composed", "tears", "performances", "oasis", "baseline", "cab", "angry", "societies", "silicon", "brazilian", "identical", "petroleum", "compete", "ist", "norwegian", "lover", "belong", "honolulu", "beatles", "lips", "retention", "exchanges", "pond", "rolls", "thomson", "barnes", "soundtrack", "wondering", "malta", "daddy", "ferry", "rabbit", "profession", "seating", "dam", "cnn", "separately", "physiology", "lil", "collecting", "das", "exports", "omaha", "tire", "participant", "scholarships", "recreational", "dominican", "chad", "electron", "loads", "friendship", "heather", "passport", "motel", "unions", "treasury", "warrant", "sys", "solaris", "frozen", "occupied", "josh", "royalty", "scales", "rally", "observer", "sunshine", "strain", "drag", "ceremony", "somehow", "arrested", "expanding", "provincial", "investigations", "icq", "ripe", "yamaha", "rely", "medications", "hebrew", "gained", "rochester", "dying", "laundry", "stuck", "solomon", "placing", "stops", "homework", "adjust", "assessed", "advertiser", "enabling", "encryption", "filling", "downloadable", "sophisticated", "imposed", "silence", "scsi", "focuses", "soviet", "possession", "laboratories", "treaty", "vocal", "trainer", "organ", "stronger", "volumes", "advances", "vegetables", "lemon", "toxic", "dns", "thumbnails", "darkness", "pty", "nuts", "nail", "bizrate", "vienna", "implied", "span", "stanford", "sox", "stockings", "joke", "respondent", "packing", "statute", "rejected", "satisfy", "destroyed", "shelter", "chapel", "gamespot", "manufacture", "layers", "wordpress", "guided", "vulnerability", "accountability", "celebrate", "accredited", "appliance", "compressed", "bahamas", "powell", "mixture", "bench", "univ", "tub", "rider", "scheduling", "radius", "perspectives", "mortality", "logging", "hampton", "christians", "borders", "therapeutic", "pads", "butts", "inns", "bobby", "impressive", "sheep", "accordingly", "architect", "railroad", "lectures", "challenging", "wines", "nursery", "harder", "cups", "ash", "microwave", "cheapest", "accidents", "travesti", "relocation", "stuart", "contributors", "salvador", "ali", "salad", "monroe", "tender", "violations", "foam", "temperatures", "paste", "clouds", "competitions", "discretion", "tft", "tanzania", "preserve", "jvc", "poem", "unsigned", "staying", "cosmetics", "easter", "theories", "repository", "praise", "jeremy", "venice", "concentrations", "estonia", "christianity", "veteran", "streams", "landing", "signing", "executed", "katie", "negotiations", "realistic", "cgi", "showcase", "integral", "asks", "relax", "namibia", "generating", "christina", "congressional", "synopsis", "hardly", "prairie", "reunion", "composer", "bean", "sword", "absent", "photographic", "sells", "ecuador", "hoping", "accessed", "spirits", "modifications", "coral", "pixel", "float", "colin", "bias", "imported", "paths", "bubble", "por", "acquire", "contrary", "millennium", "tribune", "vessel", "acids", "focusing", "viruses", "cheaper", "admitted", "dairy", "admit", "mem", "fancy", "equality", "samoa", "achieving", "tap", "stickers", "fisheries", "exceptions", "reactions", "leasing", "lauren", "beliefs", "macromedia", "companion", "squad", "analyze", "ashley", "scroll", "relate", "divisions", "swim", "wages", "additionally", "suffer", "forests", "fellowship", "nano", "invalid", "concerts", "martial", "males", "victorian", "retain", "execute", "tunnel", "genres", "cambodia", "patents", "copyrights", "chaos", "lithuania", "mastercard", "wheat", "chronicles", "obtaining", "beaver", "updating", "distribute", "readings", "decorative", "kijiji", "confused", "compiler", "enlargement", "eagles", "bases", "vii", "accused", "bee", "campaigns", "unity", "loud", "conjunction", "bride", "rats", "defines", "airports", "instances", "indigenous", "begun", "cfr", "brunette", "packets", "anchor", "socks", "validation", "parade", "corruption", "stat", "trigger", "incentives", "cholesterol", "gathered", "essex", "slovenia", "notified", "differential", "beaches", "folders", "dramatic", "surfaces", "terrible", "routers", "cruz", "pendant", "dresses", "baptist", "scientist", "starsmerchant", "hiring", "clocks", "arthritis", "bios", "females", "wallace", "nevertheless", "reflects", "taxation", "fever", "pmc", "cuisine", "surely", "practitioners", "transcript", "myspace", "theorem", "inflation", "thee", "ruth", "pray", "stylus", "compounds", "pope", "drums", "contracting", "arnold", "structured", "reasonably", "jeep", "chicks", "bare", "hung", "cattle", "mba", "radical", "graduates", "rover", "recommends", "controlling", "treasure", "reload", "distributors", "flame", "levitra", "tanks", "assuming", "monetary", "elderly", "pit", "arlington", "mono", "particles", "floating", "extraordinary", "tile", "indicating", "bolivia", "spell", "hottest", "stevens", "coordinate", "kuwait", "exclusively", "emily", "alleged", "limitation", "widescreen", "compile", "webster", "struck", "illustration", "plymouth", "warnings", "construct", "apps", "inquiries", "bridal", "annex", "mag", "gsm", "inspiration", "tribal", "curious", "affecting", "freight", "rebate", "meetup", "eclipse", "sudan", "ddr", "downloading", "rec", "shuttle", "aggregate", "stunning", "cycles", "affects", "forecasts", "detect", "actively", "ciao", "ampland", "knee", "prep", "complicated", "chem", "fastest", "butler", "shopzilla", "injured", "decorating", "payroll", "cookbook", "expressions", "ton", "courier", "uploaded", "shakespeare", "hints", "collapse", "americas", "connectors", "unlikely", "gif", "pros", "conflicts", "techno", "beverage", "tribute", "wired", "elvis", "immune", "latvia", "travelers", "forestry", "barriers", "cant", "rarely", "gpl", "infected", "offerings", "martha", "genesis", "barrier", "argue", "incorrect", "trains", "metals", "bicycle", "furnishings", "letting", "arise", "guatemala", "celtic", "thereby", "irc", "jamie", "particle", "perception", "minerals", "advise", "humidity", "bottles", "boxing", "bangkok", "renaissance", "pathology", "sara", "bra", "ordinance", "hughes", "photographers", "infections", "jeffrey", "chess", "operates", "brisbane", "configured", "survive", "oscar", "festivals", "menus", "joan", "possibilities", "duck", "reveal", "canal", "amino", "phi", "contributing", "herbs", "clinics", "mls", "cow", "manitoba", "analytical", "missions", "watson", "lying", "costumes", "strict", "dive", "saddam", "circulation", "drill", "offense", "bryan", "cet", "protest", "assumption", "jerusalem", "hobby", "tries", "transexuales", "invention", "nickname", "fiji", "technician", "inline", "executives", "enquiries", "washing", "audi", "staffing", "cognitive", "exploring", "trick", "enquiry", "closure", "raid", "ppc", "timber", "volt", "intense", "div", "playlist", "registrar", "showers", "supporters", "ruling", "steady", "dirt", "statutes", "withdrawal", "myers", "drops", "predicted", "wider", "saskatchewan", "cancellation", "plugins", "enrolled", "sensors", "screw", "ministers", "publicly", "hourly", "blame", "geneva", "freebsd", "veterinary", "acer", "prostores", "reseller", "dist", "handed", "suffered", "intake", "informal", "relevance", "incentive", "butterfly", "tucson", "mechanics", "heavily", "swingers", "fifty", "headers", "mistakes", "numerical", "ons", "geek", "uncle", "defining", "counting", "reflection", "sink", "accompanied", "assure", "invitation", "devoted", "princeton", "jacob", "sodium", "randy", "spirituality", "hormone", "meanwhile", "proprietary", "timothy", "childrens", "brick", "grip", "naval", "thumbzilla", "medieval", "porcelain", "avi", "bridges", "pichunter", "captured", "watt", "thehun", "decent", "casting", "dayton", "translated", "shortly", "cameron", "columnists", "pins", "carlos", "reno", "donna", "andreas", "warrior", "diploma", "cabin", "innocent", "scanning", "ide", "consensus", "polo", "valium", "copying", "rpg", "delivering", "cordless", "patricia", "horn", "eddie", "uganda", "fired", "journalism", "prot", "trivia", "adidas", "perth", "frog", "grammar", "intention", "syria", "disagree", "klein", "harvey", "tires", "logs", "undertaken", "tgp", "hazard", "retro", "leo", "statewide", "semiconductor", "gregory", "episodes", "boolean", "circular", "anger", "diy", "mainland", "illustrations", "suits", "chances", "interact", "snap", "happiness", "arg", "substantially", "bizarre", "glenn", "auckland", "olympics", "fruits", "identifier", "geo", "ribbon", "calculations", "doe", "jpeg", "conducting", "startup", "suzuki", "trinidad", "ati", "kissing", "wal", "handy", "swap", "exempt", "crops", "reduces", "accomplished", "calculators", "geometry", "impression", "abs", "slovakia", "flip", "guild", "correlation", "gorgeous", "capitol", "sim", "dishes", "rna", "barbados", "chrysler", "nervous", "refuse", "extends", "fragrance", "mcdonald", "replica", "plumbing", "brussels", "tribe", "neighbors", "trades", "superb", "buzz", "transparent", "nuke", "rid", "trinity", "charleston", "handled", "legends", "boom", "calm", "champions", "floors", "selections", "projectors", "inappropriate", "exhaust", "comparing", "shanghai", "speaks", "burton", "vocational", "davidson", "copied", "scotia", "farming", "gibson", "pharmacies", "fork", "troy", "roller", "introducing", "batch", "organize", "appreciated", "alter", "nicole", "latino", "ghana", "edges", "mixing", "handles", "skilled", "fitted", "albuquerque", "harmony", "distinguished", "asthma", "projected", "assumptions", "shareholders", "twins", "developmental", "rip", "zope", "regulated", "triangle", "amend", "anticipated", "oriental", "reward", "windsor", "zambia", "completing", "gmbh", "buf", "hydrogen", "webshots", "sprint", "comparable", "chick", "advocate", "sims", "confusion", "copyrighted", "tray", "inputs", "warranties", "genome", "escorts", "documented", "thong", "medal", "paperbacks", "coaches", "vessels", "walks", "sol", "keyboards", "sage", "knives", "eco", "vulnerable", "arrange", "artistic", "bat", "honors", "booth", "indie", "reflected", "unified", "bones", "breed", "detector", "ignored", "polar", "fallen", "precise", "sussex", "respiratory", "notifications", "msgid", "transexual", "mainstream", "invoice", "evaluating", "lip", "subcommittee", "sap", "gather", "suse", "maternity", "backed", "alfred", "colonial", "carey", "motels", "forming", "embassy", "cave", "journalists", "danny", "rebecca", "slight", "proceeds", "indirect", "amongst", "wool", "foundations", "msgstr", "arrest", "volleyball", "adipex", "horizon", "deeply", "toolbox", "ict", "marina", "liabilities", "prizes", "bosnia", "browsers", "decreased", "patio", "tolerance", "surfing", "creativity", "lloyd", "describing", "optics", "pursue", "lightning", "overcome", "eyed", "quotations", "grab", "inspector", "attract", "brighton", "beans", "bookmarks", "ellis", "disable", "snake", "succeed", "leonard", "lending", "oops", "reminder", "searched", "behavioral", "riverside", "bathrooms", "plains", "sku", "raymond", "insights", "abilities", "initiated", "sullivan", "midwest", "karaoke", "trap", "lonely", "fool", "nonprofit", "lancaster", "suspended", "hereby", "observe", "julia", "containers", "attitudes", "karl", "berry", "collar", "simultaneously", "racial", "integrate", "bermuda", "amanda", "sociology", "mobiles", "screenshot", "exhibitions", "kelkoo", "confident", "retrieved", "exhibits", "officially", "consortium", "dies", "terrace", "bacteria", "pts", "replied", "seafood", "novels", "rrp", "recipients", "ought", "delicious", "traditions", "jail", "safely", "finite", "kidney", "periodically", "fixes", "sends", "durable", "mazda", "allied", "throws", "moisture", "hungarian", "roster", "referring", "symantec", "spencer", "wichita", "nasdaq", "uruguay", "ooo", "transform", "timer", "tablets", "tuning", "gotten", "educators", "tyler", "futures", "vegetable", "verse", "highs", "humanities", "independently", "wanting", "custody", "scratch", "launches", "ipaq", "alignment", "henderson", "britannica", "comm", "ellen", "competitors", "nhs", "rocket", "aye", "bullet", "towers", "racks", "lace", "nasty", "visibility", "latitude", "consciousness", "ste", "tumor", "ugly", "deposits", "beverly", "mistress", "encounter", "trustees", "watts", "duncan", "reprints", "hart", "bernard", "resolutions", "ment", "accessing", "forty", "tubes", "attempted", "col", "midlands", "priest", "floyd", "ronald", "analysts", "queue", "trance", "locale", "nicholas", "biol", "bundle", "hammer", "invasion", "witnesses", "runner", "rows", "administered", "notion", "skins", "mailed", "fujitsu", "spelling", "arctic", "exams", "rewards", "beneath", "strengthen", "defend", "frederick"
+ );
}
diff --git a/src/main/java/me/trouper/sentinel/data/storage/CommandBlockStorage.java b/src/main/java/me/trouper/sentinel/data/storage/CommandBlockStorage.java
index 3b407e0..fa94ebe 100644
--- a/src/main/java/me/trouper/sentinel/data/storage/CommandBlockStorage.java
+++ b/src/main/java/me/trouper/sentinel/data/storage/CommandBlockStorage.java
@@ -2,7 +2,7 @@ package me.trouper.sentinel.data.storage;
import io.github.itzispyder.pdk.utils.misc.config.JsonSerializable;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import java.io.File;
import java.util.ArrayList;
diff --git a/src/main/java/me/trouper/sentinel/data/storage/ExtraStorage.java b/src/main/java/me/trouper/sentinel/data/storage/ExtraStorage.java
index e5d9b84..f543b90 100644
--- a/src/main/java/me/trouper/sentinel/data/storage/ExtraStorage.java
+++ b/src/main/java/me/trouper/sentinel/data/storage/ExtraStorage.java
@@ -2,7 +2,7 @@ package me.trouper.sentinel.data.storage;
import io.github.itzispyder.pdk.utils.misc.config.JsonSerializable;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.SerialLocation;
+import me.trouper.sentinel.data.types.SerialLocation;
import java.io.File;
import java.util.HashMap;
diff --git a/src/main/java/me/trouper/sentinel/data/storage/NBTStorage.java b/src/main/java/me/trouper/sentinel/data/storage/NBTStorage.java
index 5c89099..0e3f1c2 100644
--- a/src/main/java/me/trouper/sentinel/data/storage/NBTStorage.java
+++ b/src/main/java/me/trouper/sentinel/data/storage/NBTStorage.java
@@ -1,41 +1,76 @@
package me.trouper.sentinel.data.storage;
-import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
import io.github.itzispyder.pdk.utils.misc.config.JsonSerializable;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.data.types.NBTHolder;
+import me.trouper.sentinel.utils.ItemBuilder;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Material;
-import org.bukkit.configuration.ConfigurationSection;
-import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.ItemStack;
import java.io.*;
import java.nio.charset.StandardCharsets;
-import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class NBTStorage implements JsonSerializable {
- public Map caughtItems = new HashMap<>();
-
+ /**
+ * A lightweight, serializable class to hold item metadata in memory.
+ * This is what gets stored in the main nbt.json file.
+ */
+ public static class Metadata {
+ public final UUID owner;
+ public final long timestamp;
+ public final int byteSize;
+
+ // Private no-arg constructor for JSON deserialization
+ private Metadata() {
+ this(null, 0, 0);
+ }
+
+ public Metadata(UUID owner, long timestamp, int byteSize) {
+ this.owner = owner;
+ this.timestamp = timestamp;
+ this.byteSize = byteSize;
+ }
+ }
+
+ // The map stores a filename key and the lightweight Metadata object.
+ // The large item data is NOT stored in memory.
+ public Map caughtItems = new HashMap<>();
+
public void storeItem(ItemStack item, UUID owner) {
+ // Use NBTHolder as a temporary tool to get the serialized data and metadata.
+ NBTHolder holder = new NBTHolder(item, owner);
+ String nbt = holder.getBase64Item();
+
+ if (nbt == null) {
+ System.err.println("Failed to serialize item for NBT storage.");
+ return;
+ }
+
File storageDir = new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "storage/nbt");
String fileName = UUID.randomUUID().toString() + ".nbt";
File file = new File(storageDir, fileName);
+
try (FileOutputStream fos = new FileOutputStream(file);
OutputStreamWriter writer = new OutputStreamWriter(fos, StandardCharsets.UTF_8)) {
-
- String nbt = serializeItem(item);
writer.write(nbt);
} catch (IOException e) {
e.printStackTrace();
+ return; // Do not save metadata if file write fails.
}
- caughtItems.put(fileName, owner.toString());
+
+ // Create the lightweight metadata object and store it in the map.
+ Metadata metadata = new Metadata(holder.getOwner(), holder.getTimestamp(), holder.getByteSize());
+ caughtItems.put(fileName, metadata);
save();
}
-
+
public boolean deleteItem(String fileName) {
File storageDir = new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "storage/nbt");
File file = new File(storageDir, fileName);
@@ -48,75 +83,30 @@ public class NBTStorage implements JsonSerializable {
File storageDir = new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "storage/nbt");
File file = new File(storageDir, fileName);
try (FileInputStream fis = new FileInputStream(file)) {
- StringBuilder b64 = new StringBuilder();
- int content;
- while ((content = fis.read()) != -1) {
- b64.append((char) content);
- }
-
- return deserializeItem(b64.toString());
+ String b64 = new String(fis.readAllBytes(), StandardCharsets.UTF_8);
+ // Use the static decoder from NBTHolder to avoid duplicate code.
+ return NBTHolder.decodeItem(b64);
} catch (FileNotFoundException e) {
+ // Cleanup the metadata entry if the corresponding file is missing.
Sentinel.getInstance().getDirector().io.nbtStorage.caughtItems.remove(fileName);
Sentinel.getInstance().getDirector().io.nbtStorage.save();
return new ItemBuilder().material(Material.STRUCTURE_VOID)
- .name(Text.color("&cFile not found."))
- .lore(Text.color("&7This item no longer exists and has been removed from the list."))
+ .displayName(Component.text("File not found.", NamedTextColor.RED).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Component.text("This item no longer exists and has been removed from the list.",NamedTextColor.GRAY))
.build();
} catch (IOException e) {
e.printStackTrace();
return new ItemBuilder().material(Material.STRUCTURE_VOID)
- .name(Text.color("&cUnknown IO exception."))
- .lore(Text.color("&4Check Console."))
+ .displayName(Component.text("Unknown IO Exception.", NamedTextColor.RED).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Component.text("Check console for details.",NamedTextColor.DARK_RED))
.build();
}
}
-
- public static String serializeItem(ItemStack item) {
- if (item == null) {
- return null;
- }
- try {
- Map serializedItem = item.serialize();
-
- YamlConfiguration config = new YamlConfiguration();
- config.set("item", serializedItem);
- String yamlString = config.saveToString();
-
- return Base64.getEncoder().encodeToString(yamlString.getBytes(StandardCharsets.UTF_8));
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public static ItemStack deserializeItem(String data) {
- if (data == null || data.isEmpty()) {
- return null;
- }
- try {
- byte[] decodedData = Base64.getDecoder().decode(data);
- String yamlString = new String(decodedData, StandardCharsets.UTF_8);
-
- YamlConfiguration config = new YamlConfiguration();
- config.loadFromString(yamlString);
-
- ConfigurationSection itemSection = config.getConfigurationSection("item");
- if (itemSection == null) {
- return null;
- }
-
- Map serializedItem = itemSection.getValues(true);
-
- return ItemStack.deserialize(serializedItem);
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
@Override
public File getFile() {
File file = new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "storage/nbt.json");
+ // Ensure the directory for individual .nbt files exists.
new File(Sentinel.getInstance().getDirector().io.getDataFolder(), "storage/nbt").mkdirs();
file.getParentFile().mkdirs();
return file;
diff --git a/src/main/java/me/trouper/sentinel/data/misc/CommandBlockHolder.java b/src/main/java/me/trouper/sentinel/data/types/CommandBlockHolder.java
similarity index 91%
rename from src/main/java/me/trouper/sentinel/data/misc/CommandBlockHolder.java
rename to src/main/java/me/trouper/sentinel/data/types/CommandBlockHolder.java
index 51512cd..b8156a1 100644
--- a/src/main/java/me/trouper/sentinel/data/misc/CommandBlockHolder.java
+++ b/src/main/java/me/trouper/sentinel/data/types/CommandBlockHolder.java
@@ -1,12 +1,12 @@
-package me.trouper.sentinel.data.misc;
+package me.trouper.sentinel.data.types;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientUpdateCommandBlock;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientUpdateCommandBlockMinecart;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.utils.DisplayUtils;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.server.Main;
+import me.trouper.sentinel.utils.*;
import me.trouper.sentinel.utils.display.BlockDisplayRaytracer;
+import me.trouper.sentinel.utils.display.DisplayUtils;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@@ -18,7 +18,7 @@ import org.bukkit.persistence.PersistentDataType;
import java.util.List;
-public class CommandBlockHolder {
+public class CommandBlockHolder implements Main {
private String owner;
private SerialLocation loc;
@@ -46,7 +46,7 @@ public class CommandBlockHolder {
public CommandBlockHolder setOwner(String owner) {
this.owner = owner;
- Sentinel.getInstance().getDirector().io.whitelistStorage.save();
+ main.dir().io.whitelistStorage.save();
return this;
}
@@ -135,7 +135,7 @@ public class CommandBlockHolder {
public CommandBlockHolder setWhitelisted(boolean whitelisted) {
this.whitelisted = whitelisted;
- Sentinel.getInstance().getDirector().io.whitelistStorage.save();
+ main.dir().io.whitelistStorage.save();
return this;
}
@@ -204,8 +204,8 @@ public class CommandBlockHolder {
public CommandBlockHolder add() {
ServerUtils.verbose(1,"Adding command block...");
- Sentinel.getInstance().getDirector().io.whitelistStorage.add(this);
- Sentinel.getInstance().getDirector().io.whitelistStorage.save();
+ main.dir().io.whitelistStorage.add(this);
+ main.dir().io.whitelistStorage.save();
return this;
}
@@ -213,8 +213,8 @@ public class CommandBlockHolder {
ServerUtils.verbose(1,"Deleting & Destroying command block...");
if (this.loc.isUUID() && Bukkit.getEntity(this.loc.toUIID()) != null) Bukkit.getEntity(this.loc.toUIID()).remove();
else SerialLocation.translate(this.loc).getBlock().setType(Material.AIR);
- Sentinel.getInstance().getDirector().io.whitelistStorage.remove(this);
- Sentinel.getInstance().getDirector().io.whitelistStorage.save();
+ main.dir().io.whitelistStorage.remove(this);
+ main.dir().io.whitelistStorage.save();
}
public void highlight(Player viewer, Material color) {
@@ -295,10 +295,7 @@ public class CommandBlockHolder {
if (!preLoaded) where.getChunk().unload();
}
- if (changesMade) {
- updater.sendMessage(Text.prefix("Successfully updated a &b%s&7.".formatted(Text.cleanName(this.type()))));
- updater.playSound(updater.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING,1,1.5F);
- }
+ if (changesMade) Text.messageAny(Text.Pallet.SUCCESS,updater, "Successfully updated a {0}.", FormatUtils.formatType(this.type));
return changesMade;
}
@@ -322,10 +319,8 @@ public class CommandBlockHolder {
}
- if (changesMade) {
- updater.sendMessage(Text.prefix("Successfully updated a &b%s&7.".formatted(Text.cleanName(this.type()))));
- updater.playSound(updater.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING,1,1.5F);
- }
+ if (changesMade) Text.messageAny(Text.Pallet.SUCCESS,updater,"Successfully updated a {0}.", FormatUtils.formatType(this.type()));
+
return changesMade;
}
@@ -372,10 +367,8 @@ public class CommandBlockHolder {
changesMade = true;
}
- if (changesMade) {
- updater.sendMessage(Text.prefix("Successfully updated a &b%s&7.".formatted(Text.cleanName(this.type()))));
- updater.playSound(updater.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING,1,1.5F);
- }
+ if (changesMade) Text.messageAny(Text.Pallet.SUCCESS,updater,"Successfully updated a {0}.", FormatUtils.formatType(this.type()));
+
return changesMade;
}
}
diff --git a/src/main/java/me/trouper/sentinel/data/misc/Emojis.java b/src/main/java/me/trouper/sentinel/data/types/Emojis.java
similarity index 98%
rename from src/main/java/me/trouper/sentinel/data/misc/Emojis.java
rename to src/main/java/me/trouper/sentinel/data/types/Emojis.java
index 17793a1..bab6afd 100644
--- a/src/main/java/me/trouper/sentinel/data/misc/Emojis.java
+++ b/src/main/java/me/trouper/sentinel/data/types/Emojis.java
@@ -1,4 +1,4 @@
-package me.trouper.sentinel.data.misc;
+package me.trouper.sentinel.data.types;
public class Emojis {
public static String space = "<:space:1210008300515762238>";
diff --git a/src/main/java/me/trouper/sentinel/data/misc/IPLocation.java b/src/main/java/me/trouper/sentinel/data/types/IPLocation.java
similarity index 98%
rename from src/main/java/me/trouper/sentinel/data/misc/IPLocation.java
rename to src/main/java/me/trouper/sentinel/data/types/IPLocation.java
index 2b8d050..c69f12e 100644
--- a/src/main/java/me/trouper/sentinel/data/misc/IPLocation.java
+++ b/src/main/java/me/trouper/sentinel/data/types/IPLocation.java
@@ -1,4 +1,4 @@
-package me.trouper.sentinel.data.misc;
+package me.trouper.sentinel.data.types;
public class IPLocation {
private String country;
diff --git a/src/main/java/me/trouper/sentinel/data/types/NBTHolder.java b/src/main/java/me/trouper/sentinel/data/types/NBTHolder.java
new file mode 100644
index 0000000..9cd7245
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/data/types/NBTHolder.java
@@ -0,0 +1,73 @@
+package me.trouper.sentinel.data.types;
+
+import org.bukkit.inventory.ItemStack;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.UUID;
+
+public class NBTHolder {
+
+ private final String base64Item;
+ private final UUID owner;
+ private final long timestamp;
+ private final int byteSize;
+
+ public NBTHolder(ItemStack item, UUID owner) {
+ this.base64Item = encodeItem(item);
+ this.owner = owner;
+ this.timestamp = System.currentTimeMillis();
+ this.byteSize = base64Item != null ? base64Item.getBytes(StandardCharsets.UTF_8).length : 0;
+ }
+
+ public UUID getOwner() {
+ return owner;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public int getByteSize() {
+ return byteSize;
+ }
+
+ public ItemStack getItem() {
+ return decodeItem(base64Item);
+ }
+
+ public String getBase64Item() {
+ return base64Item;
+ }
+
+ /**
+ * Encodes an ItemStack into a Base64 string using the modern, robust byte array serialization.
+ * @param item The item to encode.
+ * @return A Base64 string representing the item.
+ */
+ public static String encodeItem(ItemStack item) {
+ if (item == null) return null;
+ try {
+ byte[] itemBytes = item.serializeAsBytes();
+ return Base64.getEncoder().encodeToString(itemBytes);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Decodes a Base64 string back into an ItemStack using byte array deserialization.
+ * @param base64 The Base64 string to decode.
+ * @return The deserialized ItemStack.
+ */
+ public static ItemStack decodeItem(String base64) {
+ if (base64 == null || base64.isEmpty()) return null;
+ try {
+ byte[] itemBytes = Base64.getDecoder().decode(base64);
+ return ItemStack.deserializeBytes(itemBytes);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/data/misc/Selection.java b/src/main/java/me/trouper/sentinel/data/types/Selection.java
similarity index 98%
rename from src/main/java/me/trouper/sentinel/data/misc/Selection.java
rename to src/main/java/me/trouper/sentinel/data/types/Selection.java
index bd7342f..7d2f63c 100644
--- a/src/main/java/me/trouper/sentinel/data/misc/Selection.java
+++ b/src/main/java/me/trouper/sentinel/data/types/Selection.java
@@ -1,4 +1,4 @@
-package me.trouper.sentinel.data.misc;
+package me.trouper.sentinel.data.types;
import me.trouper.sentinel.utils.display.BlockDisplayRaytracer;
import org.bukkit.Location;
diff --git a/src/main/java/me/trouper/sentinel/data/misc/SerialLocation.java b/src/main/java/me/trouper/sentinel/data/types/SerialLocation.java
similarity index 98%
rename from src/main/java/me/trouper/sentinel/data/misc/SerialLocation.java
rename to src/main/java/me/trouper/sentinel/data/types/SerialLocation.java
index ee506d7..f7a17a0 100644
--- a/src/main/java/me/trouper/sentinel/data/misc/SerialLocation.java
+++ b/src/main/java/me/trouper/sentinel/data/types/SerialLocation.java
@@ -1,4 +1,4 @@
-package me.trouper.sentinel.data.misc;
+package me.trouper.sentinel.data.types;
import me.trouper.sentinel.utils.MathUtils;
import org.bukkit.Bukkit;
diff --git a/src/main/java/me/trouper/sentinel/Director.java b/src/main/java/me/trouper/sentinel/server/Director.java
similarity index 86%
rename from src/main/java/me/trouper/sentinel/Director.java
rename to src/main/java/me/trouper/sentinel/server/Director.java
index b7ae5d0..dc78a1b 100644
--- a/src/main/java/me/trouper/sentinel/Director.java
+++ b/src/main/java/me/trouper/sentinel/server/Director.java
@@ -1,11 +1,10 @@
-package me.trouper.sentinel;
+package me.trouper.sentinel.server;
+import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.IO;
import me.trouper.sentinel.server.functions.helpers.CBWhitelistManager;
import me.trouper.sentinel.server.functions.helpers.MessageHandler;
import me.trouper.sentinel.server.functions.helpers.ReportHandler;
-import me.trouper.sentinel.startup.BackdoorDetection;
-import me.trouper.sentinel.startup.Injection;
import me.trouper.sentinel.startup.Telemetry;
import me.trouper.sentinel.startup.drm.Auth;
import me.trouper.sentinel.startup.drm.Loader;
@@ -14,10 +13,8 @@ import me.trouper.sentinel.utils.ServerUtils;
public final class Director {
public Loader loader;
- public BackdoorDetection backdoorDetection;
public Auth auth;
public Telemetry telemetry;
- public Injection injection;
public IO io;
public CBWhitelistManager whitelistManager;
public MessageHandler messageHandler;
@@ -28,8 +25,6 @@ public final class Director {
telemetry = new Telemetry();
auth = new Auth();
loader = new Loader();
- backdoorDetection = new BackdoorDetection();
- injection = new Injection();
io = new IO();
whitelistManager = new CBWhitelistManager();
messageHandler = new MessageHandler();
diff --git a/src/main/java/me/trouper/sentinel/server/Main.java b/src/main/java/me/trouper/sentinel/server/Main.java
new file mode 100644
index 0000000..976c64a
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/Main.java
@@ -0,0 +1,93 @@
+package me.trouper.sentinel.server;
+
+import io.papermc.paper.registry.RegistryAccess;
+import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.data.IO;
+import me.trouper.sentinel.data.config.lang.LanguageFile;
+import me.trouper.sentinel.utils.Text;
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+
+import java.util.Random;
+import java.util.function.BooleanSupplier;
+import java.util.logging.Logger;
+
+public interface Main {
+ Main main = new Main() {};
+
+ Random random = new Random();
+
+ default RegistryAccess getRegistryAccess() {
+ return RegistryAccess.registryAccess();
+ }
+
+ default Sentinel getPlugin() {
+ return Sentinel.getInstance();
+ }
+
+ default Logger getLogger() {
+ return getPlugin().getLogger();
+ }
+
+ default Director dir() {
+ return getPlugin().getDirector();
+ }
+
+ default IO io() {
+ return dir().io;
+ };
+
+ default LanguageFile lang() {
+ return io().lang;
+ }
+
+ default void infoAny(Audience player, String message, Object... args) {
+ Text.messageAny(Text.Pallet.INFO, player, message, args);
+ }
+
+ default void errorAny(Audience player, String message, Object... args) {
+ Text.messageAny(Text.Pallet.ERROR,player, message, args);
+ }
+
+ default void warningAny(Audience player, String message, Object... args) {
+ Text.messageAny(Text.Pallet.WARNING, player, message, args);
+ }
+
+ default void successAny(Audience player, String message, Object... args) {
+ Text.messageAny(Text.Pallet.SUCCESS, player, message, args);
+ }
+
+ default void messageAny(Audience player, String message, Object... args) {
+ Text.messageAny(Text.Pallet.NEUTRAL, player, message, args);
+ }
+
+ default void info(Audience player, Component message, Component... args) {
+ Text.message(Text.Pallet.INFO, player, message, args);
+ }
+
+ default void error(Audience player, Component message, Component... args) {
+ Text.message(Text.Pallet.ERROR,player, message, args);
+ }
+
+ default void warning(Audience player, Component message, Component... args) {
+ Text.message(Text.Pallet.WARNING, player, message, args);
+ }
+
+ default void success(Audience player, Component message, Component... args) {
+ Text.message(Text.Pallet.SUCCESS, player, message, args);
+ }
+
+ default void message(Audience player, Component message, Component... args) {
+ Text.message(Text.Pallet.NEUTRAL, player, message, args);
+ }
+
+ default void checkPre(boolean check, String msg, Object... args) {
+ if (!check) {
+ throw new IllegalArgumentException(msg.formatted(args));
+ }
+ }
+
+ default void checkPre(BooleanSupplier check, String msg, Object... args) {
+ checkPre(check.getAsBoolean(), msg, args);
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/CallbackCommand.java b/src/main/java/me/trouper/sentinel/server/commands/CallbackCommand.java
index a1a5112..b858ded 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/CallbackCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/CallbackCommand.java
@@ -2,14 +2,11 @@ package me.trouper.sentinel.server.commands;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.Permission;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
import io.github.itzispyder.pdk.utils.misc.Cooldown;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.helpers.Report;
import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -17,7 +14,7 @@ import org.bukkit.entity.Player;
import java.util.UUID;
@CommandRegistry(value = "sentinelcallback", permission = @Permission("sentinel.callbacks"), printStackTrace = true)
-public class CallbackCommand implements CustomCommand {
+public class CallbackCommand implements QuickCommand {
Cooldown fpReportCooldown = new Cooldown<>();
@@ -28,18 +25,18 @@ public class CallbackCommand implements CustomCommand {
case "fpreport" -> {
if (!PlayerUtils.checkPermission(sender,"sentinel.callbacks.fpreport")) return;
if (fpReportCooldown.isOnCooldown(p.getUniqueId()) && !p.isOp()) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.cooldown.onCooldown + fpReportCooldown.getCooldown(p.getUniqueId())));
+ warningAny(sender,main.lang().cooldown.onCooldown,fpReportCooldown.getCooldownSec(p.getUniqueId()));
return;
}
long id = args.get(1).toLong();
- Report report = Sentinel.getInstance().getDirector().reportHandler.reports.get(id);
+ Report report = main.dir().reportHandler.reports.get(id);
if (report == null) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.reports.noReport));
+ errorAny(sender,main.lang().reports.noReport);
return;
}
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.reports.reportingFalsePositive));
- Sentinel.getInstance().getDirector().reportHandler.sendReport(p,report);
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.reports.falsePositiveSuccess));
+ infoAny(sender,main.lang().reports.reportingFalsePositive);
+ main.dir().reportHandler.sendReport(p,report);
+ successAny(sender,main.lang().reports.falsePositiveSuccess);
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/ExtraCommand.java b/src/main/java/me/trouper/sentinel/server/commands/ExtraCommand.java
index 66b0260..6420d9b 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/ExtraCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/ExtraCommand.java
@@ -2,23 +2,21 @@ package me.trouper.sentinel.server.commands;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
-import com.github.retrooper.packetevents.protocol.player.User;
-import com.github.retrooper.packetevents.protocol.potion.PotionEffect;
import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.play.server.*;
-import com.xxmicloxx.NoteBlockAPI.model.Song;
-import com.xxmicloxx.NoteBlockAPI.model.SoundCategory;
-import com.xxmicloxx.NoteBlockAPI.songplayer.RadioSongPlayer;
-import com.xxmicloxx.NoteBlockAPI.songplayer.SongPlayer;
-import com.xxmicloxx.NoteBlockAPI.utils.NBSDecoder;
+//import com.xxmicloxx.NoteBlockAPI.model.Song;
+//import com.xxmicloxx.NoteBlockAPI.model.SoundCategory;
+//import com.xxmicloxx.NoteBlockAPI.songplayer.RadioSongPlayer;
+//import com.xxmicloxx.NoteBlockAPI.songplayer.SongPlayer;
+//import com.xxmicloxx.NoteBlockAPI.utils.NBSDecoder;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.Permission;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.IPLocation;
-import me.trouper.sentinel.data.misc.SerialLocation;
+import me.trouper.sentinel.data.types.IPLocation;
+import me.trouper.sentinel.data.types.SerialLocation;
+import me.trouper.sentinel.server.commands.extras.AbstractExtra;
import me.trouper.sentinel.server.events.extras.ShadowRealmEvents;
import me.trouper.sentinel.utils.*;
import net.kyori.adventure.text.Component;
@@ -27,244 +25,82 @@ import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit;
import org.bukkit.Location;
-import org.bukkit.attribute.Attribute;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerKickEvent;
-import java.io.InputStream;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
-@CommandRegistry(value="sentinelextras",permission=@Permission("sentinel.extras"))
-public class ExtraCommand implements CustomCommand {
+@CommandRegistry(value="sentinelextras",permission=@Permission("sentinel.extras"),printStackTrace = true)
+public class ExtraCommand implements QuickCommand {
+
+ public final List extraRegistry = new ArrayList<>();
+
+ public ExtraCommand(List enabledExtras) {
+ extraRegistry.addAll(enabledExtras);
+ }
+
@Override
public void dispatchCommand(CommandSender sender, Command command, String s, Args args) {
if (!PlayerUtils.isTrusted(sender)) {
- sender.sendMessage(Sentinel.getInstance().getDirector().io.lang.permissions.noTrust);
+ warningAny(sender,main.dir().io.lang.permissions.noTrust);
return;
}
if (args.getSize() < 2) {
- sender.sendMessage(Text.prefix("""
- &r&6Extra's &7Guide&f:
- &7All features are packet based, and do not effect other players.
- &bSyntax&f: &7/sentinelextras
- &7Features&f:
- &7 - &bfree&f: &7Release player from shadow realm.
- &7 - &balfa&f: &7Reliable, crash player.
- &7 - &bbravo&f: &7Send player to shadow realm.
- &7 - &bcharlie&f: &7Tell player's client to delete itself.
- &7 - &bdelta&f: &7Reliable, Lock player's mouse.
- &7 - &becho&f: &7Unreliable, Inflate player's log.
- &7 - &bfoxtrot&f: &7Unreliable, Spam player with titles.
- &7 - &bgolf&f: &7Corrupt player chunks.
- &7 - &bhotel&f: &7Unreliable, spam player with bogus entities.
- &7 - &bindia&f: &7Kick with no back to server list button.
- &7 - &bjuliett&f: &7Make player's screen dim rapidly.
- &7 - &bkilo&f: &7Rick Roll the player. (Requires NoteBlockAPI)
- """));
+ Component helpMessage = Component.empty()
+ .append(Component.text("Extra's Guide",NamedTextColor.GOLD)).appendNewline()
+ .append(Component.text("All Features are packet based. \nThey do not effect other players.",NamedTextColor.GRAY)).appendNewline()
+ .append(Component.text("Syntax",NamedTextColor.AQUA)
+ .append(Component.text(": ",NamedTextColor.WHITE)
+ .append(Component.text("/sentinelextras [free]",NamedTextColor.GRAY)))).appendNewline()
+ .append(Component.text("Features",NamedTextColor.AQUA)
+ .append(Component.text(":",NamedTextColor.WHITE))).appendNewline();
+
+ for (AbstractExtra extra : extraRegistry) {
+ helpMessage = helpMessage.append(Text.format(Text.Pallet.NEUTRAL," - {0}: {1}",extra.getName(),extra.getDescription())).appendNewline();
+ }
+
+ message(sender,helpMessage);
return;
}
String target = args.get(1).toString();
Player victim = Bukkit.getPlayer(target);
if (victim == null || !victim.isOnline()) {
- sender.sendMessage("You must pick an online player.");
+ errorAny(sender,"You must pick an online player. {0} is not online!",target);
return;
}
- switch (args.get(0).toString()) {
- case "free" -> freePlayer(sender, victim, target);
- case "alfa" -> crashPlayer(sender, victim, target);
- case "bravo" -> sendToShadowRealm(sender, victim, target);
- case "charlie" -> deletePlayer(sender, victim, target);
- case "delta" -> freezePlayer(sender, victim, target);
- case "echo" -> inflatePlayerLog(sender, victim, target);
- case "foxtrot" -> spamPlayerWithTitles(sender, victim, target);
- case "golf" -> corruptPlayerChunks(sender, victim, target);
- case "hotel" -> spamPlayerWithEntities(sender, victim, target);
- case "india" -> kickPlayerWithoutBackButton(sender, victim, target);
- case "juliett" -> makePlayerDrowsy(sender,victim,target);
- case "kilo" -> rickRollPlayer(sender,victim,target);
+
+ String choice = args.get(0).toString();
+ AbstractExtra extra = null;
+
+ for (AbstractExtra abstractExtra : extraRegistry) {
+ if (!abstractExtra.getName().equals(choice)) continue;
+ extra = abstractExtra;
+ break;
}
+
+ if (extra == null) {
+ errorAny(sender,"You must pick a valid extra. {0} does not exist!",choice);
+ return;
+ }
+
+ if (args.getSize() >= 3 && Objects.equals("free",args.get(2).toString())) {
+ extra.stop(sender,victim);
+ return;
+ }
+
+ extra.execute(sender,victim);
}
@Override
public void dispatchCompletions(CommandSender commandSender, Command command, String s, CompletionBuilder b) {
b.then(b.arg("info"));
- b.then(b.arg("free", "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliett", "kilo", "lima").then(
- b.argOnlinePlayers()
+ List extras = new ArrayList<>();
+ extraRegistry.forEach(extra -> extras.add(extra.getName()));
+ b.then(b.arg(extras).then(
+ b.argOnlinePlayers().then(b.arg("free"))
));
}
-
- private void rickRollPlayer(CommandSender sender, Player victim, String target) {
- if (!Bukkit.getPluginManager().isPluginEnabled("NoteBlockAPI")){
- Sentinel.getInstance().getLogger().severe("*** NoteBlockAPI is not installed or not enabled. ***");
- sender.sendMessage(Text.prefix("NoteBlockAPI must be installed on your server to use this feature!"));
- return;
- }
- try (InputStream inputStream = Sentinel.class.getClassLoader().getResourceAsStream("songs/Never Gonna Give You Up.nbs")) {
- if (inputStream == null) {
- System.out.println("Resource not found in JAR!");
- return;
- }
-
- Song rickRoll = NBSDecoder.parse(inputStream);
- SongPlayer nbsp = new RadioSongPlayer(rickRoll, SoundCategory.MASTER);
- nbsp.addPlayer(victim);
- nbsp.setPlaying(true);
- sender.sendMessage(Text.prefix("Rick Rolling %s.".formatted(target)));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void makePlayerDrowsy(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- player.sendPacket(new WrapperPlayServerEntityAnimation(victim.getEntityId(), WrapperPlayServerEntityAnimation.EntityAnimationType.WAKE_UP));
- }, 1, 1);
- sender.sendMessage(Text.prefix("%s is getting very eepy.".formatted(target)));
- }
-
- private void freePlayer(CommandSender sender, Player victim, String target) {
- if (Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(victim.getUniqueId())) {
- Location to = SerialLocation.translate(Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.get(victim.getUniqueId()));
- Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.remove(victim.getUniqueId());
- Sentinel.getInstance().getDirector().io.extraStorage.save();
- victim.teleport(to);
- }
- sender.sendMessage(Text.prefix("Released %s.".formatted(target)));
- }
-
- private void crashPlayer(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- player.sendPacket(new WrapperPlayServerUpdateViewDistance(32000));
- sender.sendMessage(Text.prefix("Crashing %s.".formatted(target)));
- }
-
- private void sendToShadowRealm(CommandSender sender, Player victim, String target) {
- Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.put(victim.getUniqueId(), SerialLocation.translate(victim.getLocation()));
- Sentinel.getInstance().getDirector().io.extraStorage.save();
- ShadowRealmEvents.enforce(victim);
- sender.sendMessage(Text.prefix("Sending %s to the shadow realm.".formatted(target)));
- }
-
- private void deletePlayer(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- player.sendPacket(new WrapperPlayServerDestroyEntities(victim.getEntityId()));
- sender.sendMessage(Text.prefix("Deleting %s.".formatted(target)));
- }
-
- private void freezePlayer(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- for (int i = 0; i < 35 * 9; i++) {
- player.sendPacket(new WrapperPlayServerCloseWindow());
- player.sendPacket(new WrapperPlayServerChangeGameState(WrapperPlayServerChangeGameState.Reason.DEMO_EVENT, 0));
- }
- }, 1, 1);
- sender.sendMessage(Text.prefix("Freezing %s.".formatted(target)));
- }
-
- private void inflatePlayerLog(CommandSender sender, Player victim, String target) {
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- for (int i = 0; i < 4000; i++) {
- victim.sendMessage(":3 Baiiiiii!!!!");
- }
- }, 1, 1);
- sender.sendMessage(Text.prefix("Filling the logs of %s.".formatted(target)));
- }
-
- private void spamPlayerWithTitles(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- for (int i = 0; i < 50; i++) {
- StringBuilder message = new StringBuilder(String.valueOf(RandomUtils.generateID()));
- for (int j = 0; j < 256; j++) {
- message.append(String.valueOf(RandomUtils.generateID()));
- }
- player.sendPacket(new WrapperPlayServerTitle(
- WrapperPlayServerTitle.TitleAction.SET_TITLE,
- Component.text(message.toString()).style(Style.style().color(NamedTextColor.DARK_GREEN).decorate(TextDecoration.OBFUSCATED).build()).asComponent(),
- Component.text(message.toString()).style(Style.style().color(NamedTextColor.DARK_GREEN).decorate(TextDecoration.OBFUSCATED).build()).asComponent(),
- Component.text(message.toString()).style(Style.style().color(NamedTextColor.DARK_GREEN).decorate(TextDecoration.OBFUSCATED).build()).asComponent(),
- 0, 10000, 0
- ));
- }
- }, 1, 1);
- sender.sendMessage(Text.prefix("Flooding %s's screen.".formatted(target)));
- }
-
- private void corruptPlayerChunks(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- for (int i = 0; i < 50; i++) {
- int chunkX = (victim.getLocation().getBlockX() >> 4) + i;
- int chunkZ = (victim.getLocation().getBlockZ() >> 4) + i;
- player.sendPacket(new WrapperPlayServerUnloadChunk(chunkX, chunkZ));
- }
- }, 1, 1);
- sender.sendMessage(Text.prefix("Corrupting %s's chunks.".formatted(target)));
- }
-
- private void spamPlayerWithEntities(CommandSender sender, Player victim, String target) {
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- AtomicInteger entityId = new AtomicInteger(999999);
- Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
- if (!victim.isOnline()) t.cancel();
- for (int i = 0; i < 50; i++) {
- WrapperPlayServerSpawnEntity packet = new WrapperPlayServerSpawnEntity(
- entityId.getAndIncrement(),
- Optional.of(UUID.randomUUID()),
- EntityTypes.ENDER_DRAGON,
- new Vector3d(victim.getLocation().getX(), victim.getLocation().getY(), victim.getLocation().getZ()),
- 0F,
- 0F,
- 0F,
- 0,
- Optional.of(new Vector3d(0, 0, 0))
- );
- player.sendPacket(packet);
- }
- }, 1, 1);
- sender.sendMessage(Text.prefix("Summoning entities on %s.".formatted(target)));
- }
-
- private void kickPlayerWithoutBackButton(CommandSender sender, Player victim, String target) {
- String beforeLines = "\n".repeat(15 * 100 + 3);
- String afterLines = "\n".repeat(15 * 100);
-
- Component image = Component.text("\n");
- for (Component component : ImageUtils.makeImage("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/x1ksxaas.png")) {
- image = image.appendNewline().append(component);
- }
- String header = "Sorry %1$s!\nLooks like you're a griefer... \n...and this is a decoy server\nYour presence has been recorded. \n\nHow's the weather in %2$s, %3$s? \n";
- String footer = "\n\nWant to try again?\n Nope. No back to server list for you.\n\nCopyright © 2025 Sentinel Anti Nuke. All rights reserved.\n";
- String name = victim.getName();
- String ip = IPUtils.extractIp(victim.getAddress().getAddress());
- IPLocation location = IPUtils.getLocation(ip);
- String region = location.getRegion();
- String city = location.getCity();
- victim.kick(Component.text(beforeLines)
- .append(Component.text(
- header.formatted(
- name,
- city,
- region
- )))
- .append(image)
- .append(Component.text(
- footer + afterLines
- )
- ),
- PlayerKickEvent.Cause.ILLEGAL_ACTION);
- sender.sendMessage(Text.prefix("Kicked %1$s and removed the back to server list button. Their IP was %2$s (%3$s %4$s)".formatted(target, ip, city, region)));
- }
-
-
}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/commands/MessageCommand.java b/src/main/java/me/trouper/sentinel/server/commands/MessageCommand.java
index 9b381f0..1ffc395 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/MessageCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/MessageCommand.java
@@ -2,12 +2,9 @@ package me.trouper.sentinel.server.commands;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.Permission;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -17,17 +14,17 @@ import java.util.ArrayList;
import java.util.List;
@CommandRegistry(value = "sentinelmessage",permission = @Permission("sentinel.message"),printStackTrace = true)
-public class MessageCommand implements CustomCommand {
+public class MessageCommand implements QuickCommand {
@Override
public void dispatchCommand(CommandSender sender, Command command, String s, Args args) {
Player p = (Player) sender;
Player r = null;
if (args.getSize() == 0) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.playerInteraction.noOnlinePlayer));
+ errorAny(sender,main.dir().io.lang.playerInteraction.noOnlinePlayer);
return;
}
if (args.getSize() == 1) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.playerInteraction.noMessageProvided));
+ errorAny(sender,main.dir().io.lang.playerInteraction.noMessageProvided);
return;
}
r = Bukkit.getPlayer(args.get(0).toString());
@@ -35,8 +32,8 @@ public class MessageCommand implements CustomCommand {
String msg = args.getAll(1).toString().trim();
if (PlayerUtils.checkPermission(sender,"sentinel.message") && r != null) {
- Sentinel.getInstance().getDirector().messageHandler.messagePlayer(p,r,msg);
- } else if (r == null) p.sendMessage(Text.prefix((Sentinel.getInstance().getDirector().io.lang.playerInteraction.noOnlinePlayer)));
+ main.dir().messageHandler.messagePlayer(p,r,msg);
+ } else if (r == null) errorAny(sender,main.dir().io.lang.playerInteraction.noOnlinePlayer);
}
@Override
diff --git a/src/main/java/me/trouper/sentinel/server/commands/QuickCommand.java b/src/main/java/me/trouper/sentinel/server/commands/QuickCommand.java
new file mode 100644
index 0000000..bac312e
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/QuickCommand.java
@@ -0,0 +1,101 @@
+package me.trouper.sentinel.server.commands;
+
+import io.github.itzispyder.pdk.commands.Args;
+import io.github.itzispyder.pdk.commands.CommandRegistry;
+import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
+import io.github.itzispyder.pdk.commands.completions.CompletionNode;
+import io.github.itzispyder.pdk.utils.misc.Voidable;
+import me.trouper.sentinel.server.Main;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.PluginCommand;
+import org.bukkit.command.TabExecutor;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public interface QuickCommand extends TabExecutor, Main {
+
+ void dispatchCommand(CommandSender sender, Command command, String label, Args args);
+
+ void dispatchCompletions(CommandSender sender, Command command, String label, CompletionBuilder b);
+
+ default void register() {
+ CommandRegistry registry = this.getClass().getAnnotation(CommandRegistry.class);
+ PluginCommand command = getPlugin().getCommand(registry.value());
+
+ if (command != null) {
+ command.setExecutor(this);
+ command.setTabCompleter(this);
+ }
+ }
+
+ @Override
+ default boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+ CommandRegistry registry = this.getClass().getAnnotation(CommandRegistry.class);
+ if (registry == null) {
+ return true;
+ }
+ if (!(sender instanceof Player) && registry.playersOnly()) {
+ infoAny(sender, "This command is for players only!");
+ return true;
+ }
+
+ try {
+ String perm = registry.permission().value();
+ if (perm != null && !perm.isEmpty() && !sender.hasPermission(perm)) {
+ errorAny(sender, registry.permission().message());
+ return true;
+ }
+ dispatchCommand(sender, command, label, new Args(args));
+ }
+ catch (Exception ex) {
+ if (registry.printStackTrace()) {
+ ex.printStackTrace();
+ }
+ infoAny(sender, "&cCorrect Usage: &7" + registry.usage());
+ }
+ return true;
+ }
+
+ @Override
+ default List onTabComplete(CommandSender sender, Command command, String label, String[] args) {
+ try {
+ CompletionBuilder b = new CompletionBuilder(label);
+ dispatchCompletions(sender, command, label, b);
+ CompletionNode node = b.getRootNode();
+
+ if (args.length == 0) {
+ return node.getOptions();
+ }
+ for (int i = 0; i < args.length - 1; i++) {
+ node = node.next(args[i]);
+ }
+
+ String end = args[args.length - 1];
+ List a = new ArrayList<>(node.getOptions());
+
+ if (node.isOptionsRegex()) {
+ List regexResult = new ArrayList<>();
+ for (CompletionNode option : node.getNextOptions()) {
+ boolean regexMatches = CompletionNode.containsRegex(option, end) || end.isEmpty();
+ for (String s : option.getValues())
+ regexResult.add((regexMatches ? "§d" : "§c") + s + "§r");
+ }
+ return regexResult;
+ }
+ else {
+ a.removeIf(s -> !s.toLowerCase().contains(end.toLowerCase()));
+ return a;
+ }
+ }
+ catch (Exception ex) {
+ return new ArrayList<>();
+ }
+ }
+
+ default Voidable getRegistry() {
+ return Voidable.of(this.getClass().getAnnotation(CommandRegistry.class));
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/ReopCommand.java b/src/main/java/me/trouper/sentinel/server/commands/ReopCommand.java
index 1061234..1bab3a1 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/ReopCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/ReopCommand.java
@@ -2,32 +2,30 @@ package me.trouper.sentinel.server.commands;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandRegistry(value = "reop")
-public class ReopCommand implements CustomCommand {
+public class ReopCommand implements QuickCommand {
@Override
public void dispatchCommand(CommandSender sender, Command command, String s, Args args) {
Player p = (Player) sender;
- if (PlayerUtils.isTrusted(p) && Sentinel.getInstance().getDirector().io.mainConfig.plugin.reopCommand) {
+ if (PlayerUtils.isTrusted(p) && main.dir().io.mainConfig.plugin.reopCommand) {
if (!p.isOp()) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.elevatingPerms));
- Sentinel.getInstance().getLogger().info(Sentinel.getInstance().getDirector().io.lang.permissions.logElevatingPerms.formatted(p.getName()));
+ successAny(sender,main.dir().io.lang.permissions.elevatingPerms);
+ Sentinel.getInstance().getLogger().info(main.dir().io.lang.permissions.logElevatingPerms.formatted(p.getName()));
p.setOp(true);
} else {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.alreadyOp));
- Sentinel.getInstance().getLogger().info(Sentinel.getInstance().getDirector().io.lang.permissions.logAlreadyOp.formatted(p.getName()));
+ infoAny(sender,main.dir().io.lang.permissions.alreadyOp);
+ Sentinel.getInstance().getLogger().info(main.dir().io.lang.permissions.logAlreadyOp.formatted(p.getName()));
p.setOp(true);
}
} else {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.noTrust));
+ errorAny(sender,main.dir().io.lang.permissions.noTrust);
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/ReplyCommand.java b/src/main/java/me/trouper/sentinel/server/commands/ReplyCommand.java
index 7cad64b..f2b0672 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/ReplyCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/ReplyCommand.java
@@ -2,12 +2,9 @@ package me.trouper.sentinel.server.commands;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.Permission;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -16,9 +13,9 @@ import java.util.Map;
import java.util.UUID;
@CommandRegistry(value = "reply", permission = @Permission("sentinel.reply"),printStackTrace = true)
-public class ReplyCommand implements CustomCommand {
+public class ReplyCommand implements QuickCommand {
- public static Map replyMap = Sentinel.getInstance().getDirector().messageHandler.replyMap;
+ public static Map replyMap = main.dir().messageHandler.replyMap;
@Override
public void dispatchCommand(CommandSender sender, Command command, String s, Args args) {
@@ -26,16 +23,16 @@ public class ReplyCommand implements CustomCommand {
Player p = sender.getServer().getPlayer(name);
UUID senderID = p.getUniqueId();
if (replyMap.get(senderID) == null) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.playerInteraction.noReply));
+ errorAny(sender,main.dir().io.lang.playerInteraction.noReply);
}
Player r = sender.getServer().getPlayer(replyMap.get(senderID));
UUID reciverID = r.getUniqueId();
if (args.get(0).toString() == null) {
- p.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.playerInteraction.noMessageProvided));
+ errorAny(sender,main.dir().io.lang.playerInteraction.noMessageProvided);
}
String msg = args.getAll().toString();
if (PlayerUtils.checkPermission(sender,"sentinel.message")) {
- Sentinel.getInstance().getDirector().messageHandler.messagePlayer(p,r,msg);
+ main.dir().messageHandler.messagePlayer(p,r,msg);
replyMap.put(senderID,reciverID);
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/SentinelCommand.java b/src/main/java/me/trouper/sentinel/server/commands/SentinelCommand.java
index 0f2c83d..0752564 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/SentinelCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/SentinelCommand.java
@@ -2,25 +2,25 @@ package me.trouper.sentinel.server.commands;
import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.commands.CommandRegistry;
-import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.Permission;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
import io.papermc.paper.chat.ChatRenderer;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
-import me.trouper.sentinel.data.misc.Selection;
-import me.trouper.sentinel.data.misc.SerialLocation;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
+import me.trouper.sentinel.data.types.NBTHolder;
+import me.trouper.sentinel.data.types.Selection;
+import me.trouper.sentinel.data.types.SerialLocation;
import me.trouper.sentinel.server.events.admin.WandEvents;
+import me.trouper.sentinel.server.events.violations.players.CreativeHotbar;
import me.trouper.sentinel.server.functions.chatfilter.profanity.ProfanityFilter;
import me.trouper.sentinel.server.functions.chatfilter.spam.SpamFilter;
import me.trouper.sentinel.server.functions.chatfilter.unicode.UnicodeFilter;
import me.trouper.sentinel.server.functions.chatfilter.url.UrlFilter;
+import me.trouper.sentinel.server.functions.hotbar.items.ItemCheck;
+import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.startup.drm.Loader;
-import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.*;
import me.trouper.sentinel.utils.trees.ConsoleFormatter;
import me.trouper.sentinel.utils.trees.EmbedFormatter;
import me.trouper.sentinel.utils.trees.Node;
@@ -34,6 +34,9 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.entity.minecart.CommandMinecart;
+import org.bukkit.event.inventory.InventoryCreativeEvent;
+import org.bukkit.event.inventory.InventoryType;
+import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
import java.util.Map;
@@ -41,7 +44,7 @@ import java.util.Set;
import java.util.UUID;
@CommandRegistry(value = "sentinel", permission = @Permission("sentinel.staff"), printStackTrace = true)
-public class SentinelCommand implements CustomCommand {
+public class SentinelCommand implements QuickCommand {
// Constants for usage messages
private static final String USAGE_SENTINEL = "Usage: /sentinel ";
@@ -58,7 +61,7 @@ public class SentinelCommand implements CustomCommand {
processCommand(sender, command, s, args);
} catch (IllegalArgumentException e) {
e.printStackTrace();
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.invalidArgs));
+ errorAny(sender, main.lang().plugin.invalidArgs);
}
}
@@ -68,28 +71,48 @@ public class SentinelCommand implements CustomCommand {
b.then(b.arg("config"));
b.then(b.arg("wand"));
b.then(b.arg("reload"));
- b.then(b.arg("false-positive").then(b.arg("add", "remove")));
- b.then(b.arg("debug").then(b.arg("lang", "toggle", "chat")));
- b.then(b.arg("commandblock", "cb").then(
- b.arg("add", "remove", "auto"))
- .then(b.arg("selection")
- .then(b.arg("add", "remove", "delete", "deselect", "pos1", "pos2")))
- .then(b.arg("restore")
- .then(b.arg("", "all")))
- .then(b.arg("clear")
- .then(b.arg("", "all"))));
+
+ b.then(
+ b.arg("false-positive")
+ .then(b.arg("add", "remove"))
+ );
+
+ b.then(
+
+ b.arg("debug")
+ .then(b.arg("lang", "toggle", "chat"))
+ .then(b.arg("nbt")
+ .then(b.arg("system","store","filter")))
+ );
+
+ b.then(
+ b.arg("commandblock", "cb")
+ .then(b.arg("add", "remove", "auto"))
+ .then(
+ b.arg("selection")
+ .then(b.arg("add", "remove", "delete", "deselect", "pos1", "pos2"))
+ )
+ .then(
+ b.arg("restore")
+ .then(b.arg("", "all"))
+ )
+ .then(
+ b.arg("clear")
+ .then(b.arg("", "all"))
+ )
+ );
}
/* Main Command Processing */
private void processCommand(CommandSender sender, Command command, String label, Args args) {
// Lite mode check
- if (Sentinel.getInstance().getDirector().loader.isLite()) {
+ if (main.dir().loader.isLite()) {
handleLiteMessage(sender, args);
return;
}
if (args.isEmpty()) {
- sender.sendMessage(Text.prefix(USAGE_SENTINEL));
+ infoAny(sender, USAGE_SENTINEL);
return;
}
@@ -102,16 +125,15 @@ public class SentinelCommand implements CustomCommand {
case "debug" -> handleDebugCommand(sender, args);
case "false-positive" -> handleFalsePositive(sender, args);
case "socialspy" -> handleSocialSpy(sender);
- default -> sender.sendMessage(Text.prefix("Invalid sub-command. " + USAGE_SENTINEL));
+ default -> errorAny(sender, "Invalid sub-command. %s", USAGE_SENTINEL);
}
}
- /* Helper Method: Ensure Sender is a Player */
private Player getPlayer(CommandSender sender) {
if (sender instanceof Player p) {
return p;
}
- sender.sendMessage(Text.prefix("Only players can execute this command."));
+ errorAny(sender, "Only players can execute this command.");
return null;
}
@@ -120,28 +142,28 @@ public class SentinelCommand implements CustomCommand {
======================= */
private void handleReload(CommandSender sender) {
if (!PlayerUtils.isTrusted(sender)) {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.noTrust));
+ errorAny(sender, main.lang().permissions.noTrust);
return;
}
- Sentinel.getInstance().getLogger().info("Sentinel is now reloading the config.");
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.reloadingConfig));
- Sentinel.getInstance().getDirector().io.loadConfig();
+ main.getLogger().info("Sentinel is now reloading the config.");
+ infoAny(sender, main.lang().plugin.reloadingConfig);
+ main.dir().io.loadConfig();
}
/* =======================
Subcommand: WAND
======================= */
private void handleWand(CommandSender sender) {
- if (!PlayerUtils.playerCheck(sender)) return;
+ if (PlayerUtils.isConsoleCheck(sender)) return;
if (!PlayerUtils.isTrusted(sender)) return;
Player p = (Player) sender;
p.give(WandEvents.SELECTION_WAND);
- sender.sendMessage(Text.prefix("Given you a selection wand."));
+ successAny(sender, "Given you a selection wand.");
}
/* =======================
Subcommand: CONFIG
- ======================= */
+ ======================= */
private void handleConfig(CommandSender sender) {
Player p = getPlayer(sender);
if (p == null) return;
@@ -158,7 +180,7 @@ public class SentinelCommand implements CustomCommand {
if (!PlayerUtils.isTrusted(sender)) return;
if (args.getSize() < 2) {
- sender.sendMessage(Text.prefix(USAGE_COMMANDBLOCK));
+ infoAny(sender, USAGE_COMMANDBLOCK);
return;
}
@@ -170,14 +192,14 @@ public class SentinelCommand implements CustomCommand {
case "auto" -> handleCommandBlockAuto(sender);
case "restore" -> handleCommandBlockRestore(sender, args);
case "clear" -> handleCommandBlockClear(sender, args);
- default -> sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.invalidSubCommand.formatted("commandblock")));
+ default -> errorAny(sender, main.lang().plugin.invalidSubCommand, "commandblock");
}
}
-
+
// --- CommandBlock -> SELECTION ---
private void handleCommandBlockSelection(CommandSender sender, Args args) {
if (args.getSize() < 3) {
- sender.sendMessage(Text.prefix(USAGE_SELECTION));
+ infoAny(sender, USAGE_SELECTION);
return;
}
Player p = getPlayer(sender);
@@ -185,21 +207,21 @@ public class SentinelCommand implements CustomCommand {
String action = args.get(2).toString().toLowerCase();
switch (action) {
- case "add" -> Sentinel.getInstance().getDirector().whitelistManager.addSelectionToWhitelist(p);
- case "remove" -> Sentinel.getInstance().getDirector().whitelistManager.removeSelectionFromWhitelist(p);
- case "delete" -> Sentinel.getInstance().getDirector().whitelistManager.deleteSelection(p);
+ case "add" -> main.dir().whitelistManager.addSelectionToWhitelist(p);
+ case "remove" -> main.dir().whitelistManager.removeSelectionFromWhitelist(p);
+ case "delete" -> main.dir().whitelistManager.deleteSelection(p);
case "deselect", "desel" -> WandEvents.selections.remove(p.getUniqueId());
case "pos1" -> {
Selection selection = WandEvents.selections.computeIfAbsent(p.getUniqueId(), k -> new Selection());
selection.setPos1(p.getLocation());
- p.sendMessage(Text.prefix("Position 1 set at " + Text.formatLoc(p.getLocation())));
+ success(p, Component.text("Position 1 set at {0}."), FormatUtils.formatLoc(p.getLocation()));
}
case "pos2" -> {
Selection selection = WandEvents.selections.computeIfAbsent(p.getUniqueId(), k -> new Selection());
selection.setPos2(p.getLocation());
- p.sendMessage(Text.prefix("Position 2 set at " + Text.formatLoc(p.getLocation())));
+ success(p, Component.text("Position 2 set at {0}."), FormatUtils.formatLoc(p.getLocation()));
}
- default -> p.sendMessage(Text.prefix("Invalid selection action. " + USAGE_SELECTION));
+ default -> errorAny(p, "Invalid selection action. %s", USAGE_SELECTION);
}
}
@@ -209,18 +231,17 @@ public class SentinelCommand implements CustomCommand {
if (p == null) return;
if (p.getTargetEntity(10) instanceof CommandMinecart cm) {
- Sentinel.getInstance().getDirector().whitelistManager
+ main.dir().whitelistManager
.generateHolder(p.getUniqueId(), cm).addAndWhitelist();
return;
}
Block target = p.getTargetBlock(Set.of(Material.AIR), 10);
if (ServerUtils.isCommandBlock(target)) {
CommandBlock cb = (CommandBlock) target.getState();
- Sentinel.getInstance().getDirector().whitelistManager
+ main.dir().whitelistManager
.generateHolder(p.getUniqueId(), cb).addAndWhitelist();
} else {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.notCommandBlock
- .formatted(Text.cleanName(target.getType().toString()))));
+ errorAny(sender, main.lang().commandBlock.notCommandBlock, FormatUtils.formatType(target.getType().toString()));
}
}
@@ -230,31 +251,27 @@ public class SentinelCommand implements CustomCommand {
if (p == null) return;
if (p.getTargetEntity(10) instanceof CommandMinecart cm) {
- CommandBlockHolder wb = Sentinel.getInstance().getDirector().whitelistManager
+ CommandBlockHolder wb = main.dir().whitelistManager
.getFromList(cm.getUniqueId());
if (wb != null) {
wb.setWhitelisted(false);
- String cleanedType = Text.cleanName(SerialLocation.translate(wb.loc()).getBlock().getType().toString());
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.removeSuccess
- .formatted(cleanedType, wb.command())));
+ String cleanedType = FormatUtils.formatType(SerialLocation.translate(wb.loc()).getBlock().getType().toString());
+ successAny(sender, main.lang().commandBlock.removeSuccess, cleanedType, wb.command());
} else {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.notWhitelisted
- .formatted(Text.cleanName(cm.getType().toString()))));
+ errorAny(sender, main.lang().commandBlock.notWhitelisted, FormatUtils.formatType(cm.getType().toString()));
}
return;
}
Block target = p.getTargetBlock(Set.of(Material.AIR), 10);
- CommandBlockHolder wb = Sentinel.getInstance().getDirector().whitelistManager
+ CommandBlockHolder wb = main.dir().whitelistManager
.getFromList(target.getLocation());
if (wb != null) {
wb.setWhitelisted(false);
- String cleanedType = Text.cleanName(SerialLocation.translate(wb.loc()).getBlock().getType().toString());
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.removeSuccess
- .formatted(cleanedType, wb.command())));
+ String cleanedType = FormatUtils.formatType(SerialLocation.translate(wb.loc()).getBlock().getType().toString());
+ successAny(sender, main.lang().commandBlock.removeSuccess, cleanedType, wb.command());
} else {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.notWhitelisted
- .formatted(Text.cleanName(target.getType().toString()))));
+ errorAny(sender, main.lang().commandBlock.notWhitelisted, FormatUtils.formatType(target.getType().toString()));
}
}
@@ -263,51 +280,47 @@ public class SentinelCommand implements CustomCommand {
Player p = getPlayer(sender);
if (p == null) return;
- var whitelistManager = Sentinel.getInstance().getDirector().whitelistManager;
+ var whitelistManager = main.dir().whitelistManager;
if (whitelistManager.autoWhitelist.contains(p.getUniqueId())) {
whitelistManager.autoWhitelist.remove(p.getUniqueId());
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.autoWhitelistOff));
+ infoAny(sender, main.lang().commandBlock.autoWhitelistOff);
} else {
whitelistManager.autoWhitelist.add(p.getUniqueId());
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.autoWhitelistOn));
+ infoAny(sender, main.lang().commandBlock.autoWhitelistOn);
}
}
// --- CommandBlock -> RESTORE ---
private void handleCommandBlockRestore(CommandSender sender, Args args) {
if (args.getSize() < 3) {
- sender.sendMessage(Text.prefix(USAGE_RESTORE));
+ infoAny(sender, USAGE_RESTORE);
return;
}
String targetPlayer = args.get(2).toString();
if (targetPlayer.equalsIgnoreCase("all")) {
- int result = Sentinel.getInstance().getDirector().whitelistManager.restoreAll();
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.restoreSuccess
- .formatted(result)));
+ int result = main.dir().whitelistManager.restoreAll();
+ successAny(sender, main.lang().commandBlock.restoreSuccess, result);
} else {
UUID id = Bukkit.getOfflinePlayer(targetPlayer).getUniqueId();
- int result = Sentinel.getInstance().getDirector().whitelistManager.restoreAll(id);
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.restorePlayerSuccess
- .formatted(result, targetPlayer)));
+ int result = main.dir().whitelistManager.restoreAll(id);
+ successAny(sender, main.lang().commandBlock.restorePlayerSuccess, result, targetPlayer);
}
}
// --- CommandBlock -> CLEAR ---
private void handleCommandBlockClear(CommandSender sender, Args args) {
if (args.getSize() < 3) {
- sender.sendMessage(Text.prefix(USAGE_CLEAR));
+ infoAny(sender, USAGE_CLEAR);
return;
}
String targetPlayer = args.get(2).toString();
if (targetPlayer.equalsIgnoreCase("all")) {
- int result = Sentinel.getInstance().getDirector().whitelistManager.clearAll();
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.clearSuccess
- .formatted(result)));
+ int result = main.dir().whitelistManager.clearAll();
+ successAny(sender, main.lang().commandBlock.clearSuccess, result);
} else {
UUID id = Bukkit.getOfflinePlayer(targetPlayer).getUniqueId();
- int result = Sentinel.getInstance().getDirector().whitelistManager.clearAll(id);
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.commandBlock.clearPlayerSuccess
- .formatted(result, targetPlayer)));
+ int result = main.dir().whitelistManager.clearAll(id);
+ successAny(sender, main.lang().commandBlock.clearPlayerSuccess, result, targetPlayer);
}
}
@@ -317,29 +330,69 @@ public class SentinelCommand implements CustomCommand {
private void handleDebugCommand(CommandSender sender, Args args) {
if (!PlayerUtils.checkPermission(sender, "sentinel.debug")) return;
if (args.getSize() < 2) {
- sender.sendMessage(Text.prefix("Usage: /sentinel debug "));
+ infoAny(sender, "Usage: /sentinel debug ");
return;
}
String sub = args.get(1).toString().toLowerCase();
switch (sub) {
- case "lang" -> sender.sendMessage(Sentinel.getInstance().getDirector().io.lang.brokenLang);
+ case "lang" -> errorAny(sender, main.lang().brokenLang);
case "toggle" -> {
- Sentinel.getInstance().getDirector().io.mainConfig.debugMode = !Sentinel.getInstance().getDirector().io.mainConfig.debugMode;
- String message = Sentinel.getInstance().getDirector().io.mainConfig.debugMode
- ? Sentinel.getInstance().getDirector().io.lang.debug.debugEnabled
- : Sentinel.getInstance().getDirector().io.lang.debug.debugDisabled;
- sender.sendMessage(Text.prefix(message));
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.debugMode = !main.dir().io.mainConfig.debugMode;
+ String message = main.dir().io.mainConfig.debugMode
+ ? main.lang().debug.debugEnabled
+ : main.lang().debug.debugDisabled;
+ infoAny(sender, message);
+ main.dir().io.mainConfig.save();
}
case "chat" -> handleDebugChat(sender, args);
- default -> sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.invalidSubCommand.formatted("debug")));
+ case "nbt" -> handleDebugNbt(sender, args);
+ default -> errorAny(sender, main.lang().plugin.invalidSubCommand, "debug");
}
}
+
+ private void handleDebugNbt(CommandSender sender, Args args) {
+ if (PlayerUtils.isConsoleCheck(sender)) return;
+ if (args.getSize() < 3) {
+ infoAny(sender, "Usage: /sentinel debug nbt ");
+ return;
+ }
+
+ Player p = (Player) sender;
+ String sub = args.get(2).toString().toLowerCase();
+ switch (sub) {
+ case "filter" -> {
+ boolean passes = new ItemCheck().passes(p.getInventory().getItemInMainHand());
+ if (passes) {
+ success(sender,Component.text("Item passes filter."));
+ } else {
+ warning(sender,Component.text("Item flags filter."));
+ }
+ }
+ case "store" -> {
+ if (p.getInventory().getItemInMainHand().isEmpty()) {
+ error(sender,Component.text("You must hold the item you wish to store."));
+ return;
+ }
+ main.dir().io.nbtStorage.storeItem(p.getInventory().getItemInMainHand(),p.getUniqueId());
+ success(sender,Component.text("Your item is now visible in the NBT Honeypot."));
+ }
+ case "system" -> {
+ ItemStack i = p.getInventory().getItemInMainHand();
+ if (i == null || i.isEmpty()) {
+ error(sender,Component.text("You must hold an item to test it."));
+ return;
+ }
+ new CreativeHotbar().scan(new InventoryCreativeEvent(p.openInventory(p.getInventory()), InventoryType.SlotType.QUICKBAR,p.getInventory().getHeldItemSlot(),i),p,i);
+ p.closeInventory();
+ success(sender,Component.text("Scanned your item."));
+ }
+ }
+ }
private void handleDebugChat(CommandSender sender, Args args) {
- if (!PlayerUtils.playerCheck(sender)) return;
+ if (PlayerUtils.isConsoleCheck(sender)) return;
if (args.getSize() < 3) {
- sender.sendMessage(Text.prefix("Usage: /sentinel debug chat "));
+ infoAny(sender, "Usage: /sentinel debug chat ");
return;
}
Player p = (Player) sender;
@@ -357,7 +410,7 @@ public class SentinelCommand implements CustomCommand {
SpamFilter.handleSpamFilter(chatEvent);
ProfanityFilter.handleProfanityFilter(chatEvent);
if (!chatEvent.isCancelled()) {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.debug.notFlagged));
+ successAny(sender, main.lang().debug.notFlagged);
}
}
@@ -366,7 +419,7 @@ public class SentinelCommand implements CustomCommand {
======================= */
private void handleFalsePositive(CommandSender sender, Args args) {
if (args.getSize() < 2) {
- sender.sendMessage(Text.prefix("Usage: /sentinel false-positive "));
+ infoAny(sender, "Usage: /sentinel false-positive ");
return;
}
if (!PlayerUtils.checkPermission(sender, "sentinel.false-positive")) return;
@@ -381,25 +434,25 @@ public class SentinelCommand implements CustomCommand {
switch (sub) {
case "add" -> {
if (!PlayerUtils.checkPermission(sender, "sentinel.false-positive.add")) return;
- Sentinel.getInstance().getDirector().io.falsePositiveList.swearWhitelist.add(falsePositive);
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.falsePositive.addSuccess.formatted(falsePositive)));
+ main.dir().io.falsePositiveList.swearWhitelist.add(falsePositive);
+ successAny(sender, main.lang().falsePositive.addSuccess, falsePositive);
info.addKeyValue("Action", "Add");
}
case "remove" -> {
if (!PlayerUtils.checkPermission(sender, "sentinel.false-positive.remove")) return;
- Sentinel.getInstance().getDirector().io.falsePositiveList.swearWhitelist.remove(falsePositive);
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.falsePositive.removeSuccess.formatted(falsePositive)));
+ main.dir().io.falsePositiveList.swearWhitelist.remove(falsePositive);
+ successAny(sender, main.lang().falsePositive.removeSuccess, falsePositive);
info.addKeyValue("Action", "Remove");
}
default -> {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.invalidSubCommand.formatted("false-positive")));
+ errorAny(sender, main.lang().plugin.invalidSubCommand, "false-positive");
return;
}
}
info.addKeyValue("False Positive Edited", falsePositive);
root.addChild(info);
- Sentinel.getInstance().getDirector().io.falsePositiveList.save();
- Sentinel.getInstance().getLogger().info(ConsoleFormatter.format(root));
+ main.dir().io.falsePositiveList.save();
+ main.getLogger().info(ConsoleFormatter.format(root));
EmbedFormatter.sendEmbed(EmbedFormatter.format(root));
}
@@ -407,16 +460,16 @@ public class SentinelCommand implements CustomCommand {
Subcommand: SOCIALSPY
======================= */
private void handleSocialSpy(CommandSender sender) {
- if (!PlayerUtils.playerCheck(sender)) return;
+ if (PlayerUtils.isConsoleCheck(sender)) return;
if (!PlayerUtils.checkPermission(sender, "sentinel.socialspy")) return;
Player p = (Player) sender;
UUID senderID = p.getUniqueId();
boolean enabled = spyMap.getOrDefault(senderID, false);
if (!enabled) {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.socialSpy.enabled));
+ infoAny(sender, main.lang().socialSpy.enabled);
spyMap.put(senderID, true);
} else {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.socialSpy.disabled));
+ infoAny(sender, main.lang().socialSpy.disabled);
spyMap.put(senderID, false);
}
}
@@ -427,19 +480,19 @@ public class SentinelCommand implements CustomCommand {
private void handleLiteMessage(CommandSender sender, Args args) {
if (!args.isEmpty() && args.get(0).toString().equalsIgnoreCase("reload")) {
if (!PlayerUtils.isTrusted(sender)) {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.noTrust));
+ errorAny(sender, main.lang().permissions.noTrust);
return;
}
- Sentinel.getInstance().getLogger().info("Sentinel is now reloading the config in lite mode.");
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.plugin.reloadingConfigLite));
- Sentinel.getInstance().getDirector().io.loadConfig();
+ main.getLogger().info("Sentinel is now reloading the config in lite mode.");
+ infoAny(sender, main.lang().plugin.reloadingConfigLite);
+ main.dir().io.loadConfig();
- if (Sentinel.getInstance().getDirector().loader.load(Sentinel.getInstance().license, Sentinel.getInstance().identifier, false)) {
+ if (main.dir().loader.load(main.getPlugin().license, main.getPlugin().identifier, false)) {
return;
}
- Sentinel.getInstance().getLogger().info("Re-authentication Failed.");
+ main.getLogger().info("Re-authentication Failed.");
} else {
- sender.sendMessage(Loader.LITE_MODE);
+ warningAny(sender, Loader.LITE_MODE);
}
}
}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/commands/TrapCommand.java b/src/main/java/me/trouper/sentinel/server/commands/TrapCommand.java
index 253f183..9218db3 100644
--- a/src/main/java/me/trouper/sentinel/server/commands/TrapCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/commands/TrapCommand.java
@@ -5,23 +5,23 @@ import io.github.itzispyder.pdk.commands.CommandRegistry;
import io.github.itzispyder.pdk.commands.CustomCommand;
import io.github.itzispyder.pdk.commands.completions.CompletionBuilder;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@CommandRegistry(value = "sentineltab")
-public class TrapCommand implements CustomCommand {
+public class TrapCommand implements QuickCommand {
@Override
public void dispatchCommand(CommandSender commandSender, Command command, String s, Args args) {
- commandSender.sendMessage(Component.text(Text.prefix("https://www.youtube.com/watch?v=4F4qzPbcFiA")).clickEvent(ClickEvent.openUrl("https://www.youtube.com/watch?v=4F4qzPbcFiA")));
+ message(commandSender,Component.text("https://www.youtube.com/watch?v=4F4qzPbcFiA").clickEvent(ClickEvent.openUrl("https://www.youtube.com/watch?v=4F4qzPbcFiA")));
}
@Override
public void dispatchCompletions(CommandSender commandSender, Command command, String s, CompletionBuilder b) {
- b.then(b.arg(Sentinel.getInstance().getDirector().io.advConfig.fakePlugins));
+ b.then(b.arg(main.dir().io.advConfig.fakePlugins));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/AbstractExtra.java b/src/main/java/me/trouper/sentinel/server/commands/extras/AbstractExtra.java
new file mode 100644
index 0000000..3e65a3b
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/AbstractExtra.java
@@ -0,0 +1,26 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import me.trouper.sentinel.server.Main;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public abstract class AbstractExtra implements Main {
+ private final String name;
+ private final String description;
+
+ public AbstractExtra(String name, String description) {
+ this.name = name;
+ this.description = description;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public abstract void execute(CommandSender sender, Player target);
+ public abstract void stop(CommandSender sender, Player target);
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/BlockShuffler.java b/src/main/java/me/trouper/sentinel/server/commands/extras/BlockShuffler.java
new file mode 100644
index 0000000..4c8c7d1
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/BlockShuffler.java
@@ -0,0 +1,69 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.protocol.player.User;
+import com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState;
+import com.github.retrooper.packetevents.util.Vector3i;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerBlockChange;
+import io.github.retrooper.packetevents.util.SpigotConversionUtil;
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+public class BlockShuffler extends AbstractExtra {
+ public BlockShuffler() {
+ super("blocks","Cube of random");
+ }
+
+ private final List scrambleBlocks = new ArrayList<>();
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ scrambleBlocks.add(target.getUniqueId());
+ User user = PacketEvents.getAPI().getPlayerManager().getUser(target);
+
+ int x = target.getLocation().getBlockX();
+ int y = target.getLocation().getBlockY();
+ int z = target.getLocation().getBlockZ();
+
+ List blockMaterials = new ArrayList<>(Arrays.stream(Material.values())
+ .filter(Material::isBlock)
+ .toList());
+ Collections.shuffle(blockMaterials);
+ ConcurrentLinkedQueue stateQueue = new ConcurrentLinkedQueue<>();
+
+ blockMaterials.forEach(material -> stateQueue.add(SpigotConversionUtil.fromBukkitBlockData(Bukkit.createBlockData(material))));
+
+ int radius = 8;
+ Bukkit.getScheduler().runTaskTimerAsynchronously(main.getPlugin(),task -> {
+ for (int xValue = x - radius; xValue < x + radius; xValue++) {
+ for (int yValue = y - radius; yValue < y + radius; yValue++) {
+ for (int zValue = z - radius; zValue < z + radius; zValue++) {
+ if (!scrambleBlocks.contains(target.getUniqueId())) {
+ task.cancel();
+ return;
+ }
+ var blockState = stateQueue.poll();
+ stateQueue.offer(blockState);
+
+ WrapperPlayServerBlockChange blockChange = new WrapperPlayServerBlockChange(new Vector3i(xValue,yValue,zValue),blockState.getGlobalId());
+ blockChange.setBlockState(blockState);
+ user.sendPacket(blockChange);
+ }
+ }
+ }
+ },0,5);
+
+ successAny(sender,"Scrambling {0}'s blocks.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ scrambleBlocks.remove(target.getUniqueId());
+ errorAny(sender,"Stopped scrambling {0}'s blocks.",target.getUniqueId());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/BookExtra.java b/src/main/java/me/trouper/sentinel/server/commands/extras/BookExtra.java
new file mode 100644
index 0000000..45d97f1
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/BookExtra.java
@@ -0,0 +1,57 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
+import com.github.retrooper.packetevents.protocol.player.InteractionHand;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerOpenBook;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSetSlot;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerTitle;
+import io.github.retrooper.packetevents.util.SpigotConversionUtil;
+import me.trouper.sentinel.utils.ImageUtils;
+import net.kyori.adventure.inventory.Book;
+import net.kyori.adventure.text.Component;
+import org.bukkit.Material;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.BookMeta;
+import org.bukkit.inventory.meta.ItemMeta;
+
+public class BookExtra extends AbstractExtra {
+
+ public BookExtra() {
+ super("book", "Sends the player a book :3");
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ ItemStack bookItem = new ItemStack(Material.WRITTEN_BOOK);
+ ItemMeta bookItemMeta = bookItem.getItemMeta();
+ BookMeta bookMeta = (BookMeta) bookItemMeta;
+
+ bookMeta.author(Component.text("The Boykisser"));
+ bookMeta.title(Component.text("Book :3"));
+ bookMeta.addPages(Component.text("""
+ You like kissing boys don't you?
+ ⢸⠂⠀⠀⠀⠘⣧⠀⠀⣟⠛⠲⢤⡀⠀⠀⣰⠏⠀⠀⠀⠀⠀⢹⡀
+ ⠀⡿⠀⠀⠀⠀⠀⠈⢷⡀⢻⡀⠀⠀⠙⢦⣰⠏⠀⠀⠀⠀⠀⠀⢸⠀
+ ⠀⡇⠀⠀⠀⠀⠀⠀⢀⣻⠞⠛⠀⠀⠀⠀⠻⠀⠀⠀⠀⠀⠀⠀⢸⠀
+ ⠀⡇⠀⠀⠀⠀⠀⠀⠛⠓⠒⠓⠓⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀
+ ⠀⢿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⠀⠀⢀⡟⠀
+ ⠀⠘⣇⠀⠘⣿⠋⢹⠛⣿⡇⠀⠀⠀⠀⣿⣿⡇⠀⢳⠉⠀⣠⡾⠁⠀
+ ⣦⣤⣽⣆⢀⡇⠀⢸⡇⣾⡇⠀⠀⠀⠀⣿⣿⡷⠀⢸⡇⠐⠛⠛⣿⠀
+ ⠹⣦⠀⠀⠸⡇⠀⠸⣿⡿⠁⢀⡀⠀⠀⠿⠿⠃⠀⢸⠇⠀⢀⡾⠁⠀
+ ⠀⠈⡿⢠⢶⣡⡄⠀⠀⠀⠀⠉⠁⠀⠀⠀⠀⠀⣴⣧⠆⠀⢻⡄⠀⠀
+ ⠀⢸⠃⠀⠘⠉⠀⠀⠀⠠⣄⡴⠲⠶⠴⠃⠀⠀⠀⠉⡀⠀⠀⢻⡄⠀
+ ⠀⠘⠒⠒⠻⢦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣤⠞⠛⠒⠛⠋⠁⠀
+ ⠀⠀⠀⠀⠀⠀⠸⣟⠓⠒⠂⠀⠀⠀⠀⠀⠈⢷⡀⠀⠀⠀⠀⠀⠀⠀
+ """));
+
+ target.openBook(bookItem);
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ infoAny(sender,"You can't un-read something...");
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/CorruptChunks.java b/src/main/java/me/trouper/sentinel/server/commands/extras/CorruptChunks.java
new file mode 100644
index 0000000..d3a75d0
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/CorruptChunks.java
@@ -0,0 +1,48 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUnloadChunk;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.Sentinel;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class CorruptChunks extends AbstractExtra {
+
+ public CorruptChunks() {
+ super("corrupt","Unload chunks around player");
+ }
+
+ private final List corrupted = new ArrayList<>();
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ corrupted.add(target.getUniqueId());
+ Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
+ if (!target.isOnline() || !corrupted.contains(target.getUniqueId())) {
+ t.cancel();
+ return;
+ }
+ for (int i = 0; i < 50; i++) {
+ int chunkX = (target.getLocation().getBlockX() >> 4) + i;
+ int chunkZ = (target.getLocation().getBlockZ() >> 4) + i;
+ player.sendPacket(new WrapperPlayServerUnloadChunk(chunkX, chunkZ));
+ }
+ }, 1, 1);
+ successAny(sender,"Corrupting {0}'s chunks.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ corrupted.remove(player.getUUID());
+ player.sendPacket(new WrapperPlayServerUpdateViewDistance(Bukkit.getViewDistance()));
+ successAny(sender,"Attempting to save {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/DeletePlayer.java b/src/main/java/me/trouper/sentinel/server/commands/extras/DeletePlayer.java
new file mode 100644
index 0000000..bf64ffa
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/DeletePlayer.java
@@ -0,0 +1,74 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
+import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
+import com.github.retrooper.packetevents.protocol.player.GameMode;
+import com.github.retrooper.packetevents.protocol.world.Difficulty;
+import com.github.retrooper.packetevents.protocol.world.WorldBlockPosition;
+import com.github.retrooper.packetevents.protocol.world.dimension.DimensionType;
+import com.github.retrooper.packetevents.resources.ResourceLocation;
+import com.github.retrooper.packetevents.util.Vector3d;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerRespawn;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import io.github.retrooper.packetevents.util.SpigotConversionUtil;
+import org.apache.commons.lang3.builder.Diff;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.Optional;
+
+public class DeletePlayer extends AbstractExtra {
+
+ public DeletePlayer() {
+ super("delete","Tell player's client to self delete");
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ player.sendPacket(new WrapperPlayServerDestroyEntities(target.getEntityId()));
+ successAny(sender,"Deleting {0}.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ var playerSpawn = new WrapperPlayServerSpawnEntity(
+ target.getEntityId(),
+ Optional.of(target.getUniqueId()),
+ EntityTypes.PLAYER,
+ new Vector3d(),
+ target.getLocation().getYaw(),
+ target.getLocation().getPitch(),
+ target.getLocation().getYaw(),
+ 0,
+ Optional.of(new Vector3d(0,0,0)
+ )
+ );
+ String world = target.getWorld().getName();
+ Difficulty difficulty = Difficulty.valueOf(target.getWorld().getDifficulty().toString());
+ GameMode gameMode = GameMode.valueOf(target.getGameMode().toString());
+ ResourceLocation location = new ResourceLocation(player.getDimension().getDimensionName());
+ WorldBlockPosition position = new WorldBlockPosition(location,target.getLocation().getBlockX(),target.getLocation().getBlockY(),target.getLocation().getBlockZ());
+ WrapperPlayServerRespawn respawn = new WrapperPlayServerRespawn(
+ player.getDimensionType(),
+ world,
+ difficulty,
+ 0L,
+ gameMode,
+ gameMode,
+ false,
+ false,
+ true,
+ location,
+ position,
+ 0
+ );
+ player.sendPacket(respawn);
+ successAny(sender,"Attempting to restore {0}. If it does not work just kick them or tell them to leave.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/DemoScreenCrash.java b/src/main/java/me/trouper/sentinel/server/commands/extras/DemoScreenCrash.java
new file mode 100644
index 0000000..c41c430
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/DemoScreenCrash.java
@@ -0,0 +1,46 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerChangeGameState;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerCloseWindow;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.Sentinel;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class DemoScreenCrash extends AbstractExtra {
+
+ public DemoScreenCrash() {
+ super("demo","Lock player's mouse and crash them");
+ }
+
+ private final List demoCrash = new ArrayList<>();
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ demoCrash.add(target.getUniqueId());
+ Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
+ if (!target.isOnline() || !demoCrash.contains(target.getUniqueId())) {
+ t.cancel();
+ return;
+ }
+ for (int i = 0; i < 35 * 9; i++) {
+ player.sendPacket(new WrapperPlayServerCloseWindow());
+ player.sendPacket(new WrapperPlayServerChangeGameState(WrapperPlayServerChangeGameState.Reason.DEMO_EVENT, 0));
+ }
+ }, 1, 1);
+ successAny(sender,"Freezing {0}.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ demoCrash.remove(target.getUniqueId());
+ successAny(sender,"Attempting to save {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/EntitySpamCrash.java b/src/main/java/me/trouper/sentinel/server/commands/extras/EntitySpamCrash.java
new file mode 100644
index 0000000..eba0139
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/EntitySpamCrash.java
@@ -0,0 +1,96 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
+import com.github.retrooper.packetevents.util.Vector3d;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnEntity;
+import me.trouper.sentinel.Sentinel;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.*;
+
+public class EntitySpamCrash extends AbstractExtra {
+
+ public EntitySpamCrash() {
+ super("entity","Spam player with bogus entities");
+ }
+
+ private final Map entityCrash = new HashMap<>();
+
+ public class EntityCache {
+ private final int startingId;
+ private int highestId;
+
+ public EntityCache(int startingId) {
+ this.highestId = startingId;
+ this.startingId = startingId;
+ }
+
+ public int getStartingId() {
+ return startingId;
+ }
+
+ public int getHighestId() {
+ return highestId;
+ }
+
+ public void setHighestId(int highestId) {
+ this.highestId = highestId;
+ }
+
+ public void incrementHighest() {
+ this.highestId = this.highestId + 1;
+ }
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ EntityCache cache = new EntityCache(target.getWorld().getEntityCount());
+ Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
+ if (!target.isOnline() || !entityCrash.containsKey(target.getUniqueId())) {
+ t.cancel();
+ }
+ for (int i = 0; i < 100; i++) {
+ cache.incrementHighest();
+ WrapperPlayServerSpawnEntity packet = new WrapperPlayServerSpawnEntity(
+ cache.getHighestId(),
+ Optional.of(UUID.randomUUID()),
+ EntityTypes.ENDER_DRAGON,
+ new Vector3d(target.getLocation().getX(), target.getLocation().getY(), target.getLocation().getZ()),
+ 0F,
+ 0F,
+ 0F,
+ 0,
+ Optional.of(new Vector3d(0, 0, 0))
+ );
+ player.sendPacket(packet);
+ }
+ }, 1, 1);
+ successAny(sender,"Summoning entities on {0}.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ if (!entityCrash.containsKey(player.getUUID())) {
+ errorAny(sender,"{0} is not being crashed.",target.getName());
+ return;
+ }
+ EntityCache cache = entityCrash.get(player.getUUID());
+ int lowest = cache.getStartingId();
+ int highest = cache.getHighestId();
+
+ int[] entities = new int[highest - lowest];
+ for (int i = lowest; i < highest; i++) {
+ entities[i - lowest] = i;
+ }
+
+ player.sendPacket(new WrapperPlayServerDestroyEntities(entities));
+ entityCrash.remove(player.getUUID());
+ successAny(sender,"Attempting to save {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/KickTroll.java b/src/main/java/me/trouper/sentinel/server/commands/extras/KickTroll.java
new file mode 100644
index 0000000..5c8a561
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/KickTroll.java
@@ -0,0 +1,56 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.data.types.IPLocation;
+import me.trouper.sentinel.utils.IPUtils;
+import me.trouper.sentinel.utils.ImageUtils;
+import net.kyori.adventure.text.Component;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.event.player.PlayerKickEvent;
+
+public class KickTroll extends AbstractExtra {
+
+ public KickTroll() {
+ super("kick","Kick the player with no back button");
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ String beforeLines = "\n".repeat(15 * 100 + 3);
+ String afterLines = "\n".repeat(15 * 100);
+
+ Component image = Component.text("\n");
+ for (Component component : ImageUtils.makeImage("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/x1ksxaas.png")) {
+ image = image.appendNewline().append(component);
+ }
+ String header = "Sorry %1$s!\nLooks like you're a griefer... \n...and this is a decoy server\nYour presence has been recorded. \n\nHow's the weather in %2$s, %3$s? \n";
+ String footer = "\n\nWant to try again?\n Nope. No back to server list for you.\n\nCopyright © 2025 Sentinel Anti Nuke. All rights reserved.\n";
+ String name = target.getName();
+ String ip = IPUtils.extractIp(target.getAddress().getAddress());
+ IPLocation location = IPUtils.getLocation(ip);
+ String region = location.getRegion();
+ String city = location.getCity();
+ target.kick(Component.text(beforeLines)
+ .append(Component.text(
+ header.formatted(
+ name,
+ city,
+ region
+ )))
+ .append(image)
+ .append(Component.text(
+ footer + afterLines
+ )
+ ),
+ PlayerKickEvent.Cause.ILLEGAL_ACTION);
+ successAny(sender,"Kicked {0} and removed the back to server list button. Their IP was {1} ({2}, {3})",target.getName(), ip, city, region);
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ errorAny(sender,"You cannot un-kick someone!");
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/MessageSpamCrash.java b/src/main/java/me/trouper/sentinel/server/commands/extras/MessageSpamCrash.java
new file mode 100644
index 0000000..d2b6551
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/MessageSpamCrash.java
@@ -0,0 +1,43 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerChatMessage;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.Sentinel;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class MessageSpamCrash extends AbstractExtra {
+
+ public MessageSpamCrash() {
+ super("spam","Crash player by spamming chat message");
+ }
+
+ private final List chatCrash = new ArrayList<>();
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ chatCrash.add(target.getUniqueId());
+ Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
+ if (!target.isOnline() || !chatCrash.contains(target.getUniqueId())) {
+ t.cancel();
+ return;
+ }
+ for (int i = 0; i < 4000; i++) {
+ target.sendMessage(":3 Baiiiiii!!!!"); // This "sendMessage" can stay
+ }
+ }, 1, 1);
+ successAny(sender,"Filling the logs of {0}.",target);
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ chatCrash.remove(target.getUniqueId());
+ successAny(sender,"Attempting to save {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/ShadowRealm.java b/src/main/java/me/trouper/sentinel/server/commands/extras/ShadowRealm.java
new file mode 100644
index 0000000..9971877
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/ShadowRealm.java
@@ -0,0 +1,36 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.data.types.SerialLocation;
+import me.trouper.sentinel.server.events.extras.ShadowRealmEvents;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class ShadowRealm extends AbstractExtra {
+
+ public ShadowRealm() {
+ super("shadow","Send player to the shadow realm");
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ main.dir().io.extraStorage.shadowRealm.put(target.getUniqueId(), SerialLocation.translate(target.getLocation()));
+ main.dir().io.extraStorage.save();
+ ShadowRealmEvents.enforce(target);
+ successAny(sender,"Sending {0} to the shadow realm.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ if (main.dir().io.extraStorage.shadowRealm.containsKey(target.getUniqueId())) {
+ Location to = SerialLocation.translate(main.dir().io.extraStorage.shadowRealm.get(target.getUniqueId()));
+ main.dir().io.extraStorage.shadowRealm.remove(target.getUniqueId());
+ main.dir().io.extraStorage.save();
+ target.teleport(to);
+ }
+ successAny(sender,"Released {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/SleepyPlayer.java b/src/main/java/me/trouper/sentinel/server/commands/extras/SleepyPlayer.java
new file mode 100644
index 0000000..2c57cf6
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/SleepyPlayer.java
@@ -0,0 +1,39 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityAnimation;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import me.trouper.sentinel.Sentinel;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class SleepyPlayer extends AbstractExtra {
+
+ public SleepyPlayer() {
+ super("eepy","Make player's screen dim rapidly");
+ }
+
+ private final List eepyPlayers = new ArrayList<>();
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ eepyPlayers.add(target.getUniqueId());
+ Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(), (t) -> {
+ if (!eepyPlayers.contains(target.getUniqueId())) t.cancel();
+ player.sendPacket(new WrapperPlayServerEntityAnimation(target.getEntityId(), WrapperPlayServerEntityAnimation.EntityAnimationType.WAKE_UP));
+ }, 1, 1);
+ successAny(sender,"{0} is getting very eepy.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ eepyPlayers.remove(target.getUniqueId());
+ successAny(sender,"Gave {0} some coffee, and they are waking up now.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/commands/extras/ViewDistanceCrash.java b/src/main/java/me/trouper/sentinel/server/commands/extras/ViewDistanceCrash.java
new file mode 100644
index 0000000..6ff8ca1
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/commands/extras/ViewDistanceCrash.java
@@ -0,0 +1,28 @@
+package me.trouper.sentinel.server.commands.extras;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateViewDistance;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class ViewDistanceCrash extends AbstractExtra {
+
+ public ViewDistanceCrash() {
+ super("view","A reliable player crash");
+ }
+
+ @Override
+ public void execute(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ player.sendPacket(new WrapperPlayServerUpdateViewDistance(32000));
+ successAny(sender,"Crashing {0}.",target.getName());
+ }
+
+ @Override
+ public void stop(CommandSender sender, Player target) {
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ player.sendPacket(new WrapperPlayServerUpdateViewDistance(Bukkit.getViewDistance()));
+ successAny(sender,"Attempting to save {0}.",target.getName());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/events/QuickListener.java b/src/main/java/me/trouper/sentinel/server/events/QuickListener.java
new file mode 100644
index 0000000..75041f8
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/server/events/QuickListener.java
@@ -0,0 +1,12 @@
+package me.trouper.sentinel.server.events;
+
+import me.trouper.sentinel.server.Main;
+import org.bukkit.Bukkit;
+import org.bukkit.event.Listener;
+
+public interface QuickListener extends Listener, Main {
+ default QuickListener register() {
+ Bukkit.getPluginManager().registerEvents(this, this.getPlugin());
+ return this;
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/server/events/admin/AntiBanEvents.java b/src/main/java/me/trouper/sentinel/server/events/admin/AntiBanEvents.java
index 1bdc40e..d2dccc2 100644
--- a/src/main/java/me/trouper/sentinel/server/events/admin/AntiBanEvents.java
+++ b/src/main/java/me/trouper/sentinel/server/events/admin/AntiBanEvents.java
@@ -2,6 +2,7 @@ package me.trouper.sentinel.server.events.admin;
import io.github.itzispyder.pdk.events.CustomListener;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.events.QuickListener;
import me.trouper.sentinel.utils.PlayerUtils;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -9,21 +10,21 @@ import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerLoginEvent;
-public class AntiBanEvents implements CustomListener {
+public class AntiBanEvents implements QuickListener {
// Well. I hope that no banning plugins use the highest priority as well, that would be embarrassing.
@EventHandler(priority = EventPriority.HIGHEST)
public void onKick(PlayerKickEvent e) {
- if (PlayerUtils.isTrusted(e.getPlayer()) && Sentinel.getInstance().getDirector().io.mainConfig.plugin.antiBan) e.setCancelled(true);
+ if (PlayerUtils.isTrusted(e.getPlayer()) && main.dir().io.mainConfig.plugin.antiBan) e.setCancelled(true);
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onLogin(PlayerLoginEvent e) {
- if (PlayerUtils.isTrusted(e.getPlayer()) && Sentinel.getInstance().getDirector().io.mainConfig.plugin.antiBan) e.allow();
+ if (PlayerUtils.isTrusted(e.getPlayer()) && main.dir().io.mainConfig.plugin.antiBan) e.allow();
}
@EventHandler(priority = EventPriority.HIGHEST)
public void beforeLogin(AsyncPlayerPreLoginEvent e) {
- if (PlayerUtils.isTrusted(e.getUniqueId()) && Sentinel.getInstance().getDirector().io.mainConfig.plugin.antiBan) e.allow();
+ if (PlayerUtils.isTrusted(e.getUniqueId()) && main.dir().io.mainConfig.plugin.antiBan) e.allow();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/admin/BlockDisplayHideEvent.java b/src/main/java/me/trouper/sentinel/server/events/admin/BlockDisplayHideEvent.java
index 35192d1..5e2531b 100644
--- a/src/main/java/me/trouper/sentinel/server/events/admin/BlockDisplayHideEvent.java
+++ b/src/main/java/me/trouper/sentinel/server/events/admin/BlockDisplayHideEvent.java
@@ -2,13 +2,14 @@ package me.trouper.sentinel.server.events.admin;
import io.github.itzispyder.pdk.events.CustomListener;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.events.QuickListener;
import org.bukkit.entity.BlockDisplay;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
-public class BlockDisplayHideEvent implements CustomListener {
+public class BlockDisplayHideEvent implements QuickListener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
diff --git a/src/main/java/me/trouper/sentinel/server/events/admin/WandEvents.java b/src/main/java/me/trouper/sentinel/server/events/admin/WandEvents.java
index c5dc8bb..33271db 100644
--- a/src/main/java/me/trouper/sentinel/server/events/admin/WandEvents.java
+++ b/src/main/java/me/trouper/sentinel/server/events/admin/WandEvents.java
@@ -1,14 +1,13 @@
package me.trouper.sentinel.server.events.admin;
-import io.github.itzispyder.pdk.events.CustomListener;
-import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
import io.github.itzispyder.pdk.utils.misc.SoundPlayer;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
-import me.trouper.sentinel.data.misc.Selection;
-import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
+import me.trouper.sentinel.data.types.Selection;
+import me.trouper.sentinel.server.events.QuickListener;
+import me.trouper.sentinel.utils.*;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -20,35 +19,37 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
+import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.inventory.ItemStack;
import java.util.*;
-public class WandEvents implements CustomListener {
- public static final ItemStack SELECTION_WAND = ItemBuilder.create()
- .material(Material.BLAZE_ROD)
- .name(Text.color("&dCommand Block Wand"))
- .lore(Text.color("&7Use this wand to manage command blocks."))
- .lore(Text.color("&7It can scan up to 10 blocks away."))
- .lore(Text.color("&7Selections are visible up to 64 blocks away."))
- .lore(Text.color("&8&l➥&r &7Left Click&8:&f Set Position 1"))
- .lore(Text.color("&8&l➥&r &7Right Click&8:&f Set Position 2"))
- .lore(Text.color("&8&l➥&r &7Break CMD Block&8:&f Remove from whitelist"))
- .lore(Text.color("&8&l➥&r &7Click CMD Block&8:&f Add to whitelist"))
- .lore(Text.color("&8&l➥&r &7Sneak&8:&f Force Position Setting"))
- .lore(Text.color("&7Blocks close to you will get highlighted when holding."))
- .lore(Text.color(" &fHighlight Color Key&8:"))
- .lore(Text.color(" &8- &cRed &7: &fNot whitelisted."))
- .lore(Text.color(" &8- &aGreen &7: &fWhitelisted."))
- .lore(Text.color(" &8- &9Blue &7: &fYour selection."))
- .lore(Text.color(" &8- &dPurple &7: &fMissing Command Block"))
- .lore(Text.color(" &8- &fBlack &7: &fUnknown Command Block (Auto-Correcting)"))
+public class WandEvents implements QuickListener {
+ public static final ItemStack SELECTION_WAND = ItemBuilder.of(Material.BLAZE_ROD)
+ .displayName(Component.text("Command Block Wand", NamedTextColor.LIGHT_PURPLE).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(
+ Text.color("&7Use this wand to manage command blocks."),
+ Text.color("&7It can scan up to 10 blocks away."),
+ Text.color("&7Selections are visible up to 64 blocks away."),
+ Text.color("&8&l➥&r &7Left Click&8:&f Set Position 1"),
+ Text.color("&8&l➥&r &7Right Click&8:&f Set Position 2"),
+ Text.color("&8&l➥&r &7Break CMD Block&8:&f Remove from whitelist"),
+ Text.color("&8&l➥&r &7Click CMD Block&8:&f Add to whitelist"),
+ Text.color("&8&l➥&r &7Sneak&8:&f Force Position Setting"),
+ Text.color("&7Blocks close to you will get highlighted when holding."),
+ Text.color(" &fHighlight Color Key&8:"),
+ Text.color(" &8- &cRed &7: &fNot whitelisted."),
+ Text.color(" &8- &aGreen &7: &fWhitelisted."),
+ Text.color(" &8- &9Blue &7: &fYour selection."),
+ Text.color(" &8- &dPurple &7: &fMissing Command Block"),
+ Text.color(" &8- &fBlack &7: &fUnknown Command Block (Auto-Correcting)")
+ )
.customModelData(1984)
.build();
public static final Map selections = new HashMap<>();
-
+
@EventHandler
public void onClickEntity(PlayerInteractEntityEvent e) {
Player p = e.getPlayer();
@@ -62,7 +63,7 @@ public class WandEvents implements CustomListener {
e.setCancelled(true);
- Sentinel.getInstance().getDirector().whitelistManager.getFromList(cm.getUniqueId()).setWhitelisted(true);
+ main.dir().whitelistManager.getFromList(cm.getUniqueId()).setWhitelisted(true);
add.play(p);
}
@@ -79,7 +80,7 @@ public class WandEvents implements CustomListener {
if (!(e.getVehicle() instanceof CommandMinecart cm)) return;
e.setCancelled(true);
- Sentinel.getInstance().getDirector().whitelistManager.getFromList(cm.getUniqueId()).setWhitelisted(false);
+ main.dir().whitelistManager.getFromList(cm.getUniqueId()).setWhitelisted(false);
remove.play(p);
}
@@ -107,7 +108,7 @@ public class WandEvents implements CustomListener {
setPos1(p, selection, loc);
} else if (ServerUtils.isCommandBlock(loc.getBlock())) {
remove.play(p);
- Sentinel.getInstance().getDirector().whitelistManager.getFromList(loc).setWhitelisted(false);
+ main.dir().whitelistManager.getFromList(loc).setWhitelisted(false);
} else {
set1.play(p);
setPos1(p, selection, loc);
@@ -119,7 +120,7 @@ public class WandEvents implements CustomListener {
setPos2(p, selection, loc);
} else if (ServerUtils.isCommandBlock(loc.getBlock())) {
add.play(p);
- Sentinel.getInstance().getDirector().whitelistManager.generateHolder(p.getUniqueId(),(CommandBlock) loc.getBlock().getState()).addAndWhitelist();
+ main.dir().whitelistManager.generateHolder(p.getUniqueId(),(CommandBlock) loc.getBlock().getState()).addAndWhitelist();
e.setCancelled(true);
} else {
e.setCancelled(true);
@@ -136,7 +137,6 @@ public class WandEvents implements CustomListener {
return;
}
- // Highlight nearby command blocks
Selection around = new Selection();
around.setPos1(p.getLocation().add(-10, -10, -10));
around.setPos2(p.getLocation().add(10, 10, 10));
@@ -144,10 +144,10 @@ public class WandEvents implements CustomListener {
.filter(block -> ServerUtils.isCommandBlock(block) && block.getLocation().distance(p.getLocation()) <= 10)
.forEach(block -> {
if (!(block.getState() instanceof CommandBlock cb)) return;
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(block.getLocation());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(block.getLocation());
Material color = Material.BLACK_CONCRETE_POWDER;
if (holder == null) {
- holder = Sentinel.getInstance().getDirector().whitelistManager.generateHolder(p.getUniqueId(), cb);
+ holder = main.dir().whitelistManager.generateHolder(p.getUniqueId(), cb);
holder.add();
} else {
color = holder.isWhitelisted() ? Material.LIME_CONCRETE_POWDER : Material.RED_CONCRETE_POWDER;
@@ -155,15 +155,14 @@ public class WandEvents implements CustomListener {
holder.highlight(p, color);
});
- // Highlight nearby command minecarts
p.getNearbyEntities(10, 10, 10).stream()
.filter(entity -> entity instanceof CommandMinecart)
.forEach(entity -> {
CommandMinecart cm = (CommandMinecart) entity;
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cm.getUniqueId());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cm.getUniqueId());
Material color = Material.BLACK_CONCRETE_POWDER;
if (holder == null) {
- holder = Sentinel.getInstance().getDirector().whitelistManager.generateHolder(p.getUniqueId(), cm);
+ holder = main.dir().whitelistManager.generateHolder(p.getUniqueId(), cm);
holder.add();
} else {
color = holder.isWhitelisted() ? Material.LIME_CONCRETE_POWDER : Material.RED_CONCRETE_POWDER;
@@ -171,8 +170,7 @@ public class WandEvents implements CustomListener {
holder.highlight(p, color);
});
- // Highlight missing command blocks
- List holdersCopy = new ArrayList<>(Sentinel.getInstance().getDirector().io.whitelistStorage.holders);
+ List holdersCopy = new ArrayList<>(main.dir().io.whitelistStorage.holders);
holdersCopy.forEach(holder -> {
if (!holder.present() && holder.isWhitelisted()) holder.highlight(p,Material.MAGENTA_CONCRETE_POWDER);
});
@@ -181,7 +179,6 @@ public class WandEvents implements CustomListener {
public static void handleDisplay() {
PlayerUtils.forEachTrusted(WandEvents::sortNear);
- // Display selections
selections.forEach((uuid, selection) -> {
Player p = Bukkit.getPlayer(uuid);
if (p == null || !p.isOnline() || !p.getInventory().getItemInMainHand().isSimilar(SELECTION_WAND)) return;
@@ -192,12 +189,12 @@ public class WandEvents implements CustomListener {
private void setPos2(Player p, Selection selection, Location loc) {
if (selection.getPos2() != null && selection.getPos2().distance(loc) < 0.1) return;
selection.setPos2(loc);
- p.sendMessage(Text.prefix("Position 2 set to " + Text.formatLoc(loc)));
+ info(p,Component.text("Position 2 set to {0}"),FormatUtils.formatLoc(loc));
}
private void setPos1(Player p, Selection selection, Location loc) {
if (selection.getPos1() != null && selection.getPos1().distance(loc) < 0.1) return;
selection.setPos1(loc);
- p.sendMessage(Text.prefix("Position 1 set to " + Text.formatLoc(loc)));
+ info(p, Component.text("Position 1 set to {0}"),FormatUtils.formatLoc(loc));
}
}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/events/extras/ShadowRealmEvents.java b/src/main/java/me/trouper/sentinel/server/events/extras/ShadowRealmEvents.java
index 41990b7..5bf9e9d 100644
--- a/src/main/java/me/trouper/sentinel/server/events/extras/ShadowRealmEvents.java
+++ b/src/main/java/me/trouper/sentinel/server/events/extras/ShadowRealmEvents.java
@@ -15,17 +15,19 @@ import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerRe
import io.github.itzispyder.pdk.events.CustomListener;
import io.github.itzispyder.pdk.utils.SchedulerUtils;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.events.QuickListener;
+import me.trouper.sentinel.utils.PacketUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
-public class ShadowRealmEvents implements CustomListener, PacketListener {
+public class ShadowRealmEvents implements QuickListener, PacketListener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player p = e.getPlayer();
- if (!Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) return;
+ if (!main.dir().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) return;
SchedulerUtils.later(20,()->{
enforce(p);
});
@@ -39,7 +41,7 @@ public class ShadowRealmEvents implements CustomListener, PacketListener {
if (e.getPacketType() == PacketType.Play.Client.PLAYER_FLYING) return;
Player player = e.getPlayer();
if (player == null) return;
- if (!Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(player.getUniqueId())) return;
+ if (!main.dir().io.extraStorage.shadowRealm.containsKey(player.getUniqueId())) return;
e.setCancelled(true);
}
@@ -59,41 +61,17 @@ public class ShadowRealmEvents implements CustomListener, PacketListener {
Player player = e.getPlayer();
if (player == null) return;
- if (!Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(player.getUniqueId())) return;
+ if (!main.dir().io.extraStorage.shadowRealm.containsKey(player.getUniqueId())) return;
e.setCancelled(true);
}
public static void enforce(Player p) {
- if (p == null || !Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) return;
- sendFakeRespawn(p);
+ if (p == null || !main.dir().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) return;
+ PacketUtils.sendFakeRespawn(p,"minecraft:the_end",Difficulty.PEACEFUL, GameMode.SPECTATOR);
Bukkit.getScheduler().runTaskTimerAsynchronously(Sentinel.getInstance(),(t)->{
- if (p == null || !p.isOnline() || !Sentinel.getInstance().getDirector().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) t.cancel();
- sendFakePosition(p,0,32767,0);
- sendCloseScreen(p);
+ if (p == null || !p.isOnline() || !main.dir().io.extraStorage.shadowRealm.containsKey(p.getUniqueId())) t.cancel();
+ PacketUtils.sendFakePosition(p,0,32767,0);
+ PacketUtils.sendCloseScreen(p);
},1,1);
}
-
- public static void sendFakeRespawn(Player victim) {
- if (victim == null || !victim.isOnline()) return;
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- WrapperPlayServerRespawn packet = new WrapperPlayServerRespawn(DimensionTypes.THE_END,"minecraft:the_end", Difficulty.PEACEFUL,1L, GameMode.SPECTATOR,null,false,false,false,null,null,null);
- player.sendPacket(packet);
- }
-
- public static void sendCloseScreen(Player victim) {
- if (victim == null || !victim.isOnline()) return;
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- if (player == null) return;
- WrapperPlayServerCloseWindow packet = new WrapperPlayServerCloseWindow();
- player.sendPacket(packet);
- }
-
- public static boolean sendFakePosition(Player victim, double x, double y, double z) {
- if (victim == null || !victim.isOnline()) return false;
- var player = PacketEvents.getAPI().getPlayerManager().getUser(victim);
- if (player == null) return false;
- WrapperPlayServerPlayerPositionAndLook packet = new WrapperPlayServerPlayerPositionAndLook(x,y,z,0,90, RelativeFlag.NONE.getMask(),0,false);
- player.sendPacket(packet);
- return true;
- }
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/AbstractViolation.java b/src/main/java/me/trouper/sentinel/server/events/violations/AbstractViolation.java
index 6beb5b0..719d757 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/AbstractViolation.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/AbstractViolation.java
@@ -1,18 +1,15 @@
package me.trouper.sentinel.server.events.violations;
import io.github.itzispyder.pdk.commands.Args;
-import io.github.itzispyder.pdk.events.CustomListener;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.ViolationConfig;
+import me.trouper.sentinel.server.events.QuickListener;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.MainGUI;
-import me.trouper.sentinel.utils.FileUtils;
-import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.*;
import me.trouper.sentinel.utils.trees.ConsoleFormatter;
import me.trouper.sentinel.utils.trees.EmbedFormatter;
import me.trouper.sentinel.utils.trees.HoverFormatter;
@@ -30,15 +27,16 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
+import java.text.Format;
import java.util.function.BiConsumer;
-public abstract class AbstractViolation implements CustomListener {
+public abstract class AbstractViolation implements QuickListener {
public abstract CustomGui getConfigGui();
public abstract void getMainPage(Inventory inv);
public abstract void onClick(InventoryClickEvent e);
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.violationConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.violationConfig);
protected void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
@@ -49,13 +47,13 @@ public abstract class AbstractViolation implements CustomListener {
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
cfg.save();
- player.sendMessage(Text.prefix("Value updated successfully"));
+ successAny(player,"Value updated successfully");
player.openInventory(getConfigGui().getInventory());
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
- public void runActions(String rootName, String rootNamePlayer, Node violationInfo, ActionConfiguration.Builder configuration) {
+ public void runActions(Component rootName, Node violationInfo, ActionConfiguration.Builder configuration) {
ActionConfiguration config = configuration.build();
Node root = new Node("Sentinel");
@@ -67,101 +65,101 @@ public abstract class AbstractViolation implements CustomListener {
root.addChild(configuration.getActionNode());
- notifyTrusted(root,(rootNamePlayer == null || rootNamePlayer.isBlank()) ? rootName : rootNamePlayer);
+ notifyTrusted(root, rootName);
if (configuration.isLoggedToDiscord()) EmbedFormatter.sendEmbed(EmbedFormatter.format(root));
Sentinel.getInstance().getLogger().info(ConsoleFormatter.format(root));
}
- public void notifyTrusted(Node root, String rootNamePlayer) {
+ public void notifyTrusted(Node root, Component rootNamePlayer) {
PlayerUtils.forEachTrusted(trusted -> {
- trusted.sendMessage(Component.text(Text.prefix(rootNamePlayer)).hoverEvent(Component.text(HoverFormatter.format(root)).asHoverEvent()));
+ message(trusted,rootNamePlayer.hoverEvent(HoverFormatter.format(root).asHoverEvent()));
});
}
public Node generatePlayerInfo(Player p) {
- Node playerInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.playerInfo);
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.name, p.getName());
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.uuid, p.getUniqueId().toString());
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.operator, p.isOp() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
- playerInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.locationField, Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.locationFormat.formatted(Math.round(p.getX()), Math.round(p.getY()), Math.round(p.getZ())));
+ Node playerInfo = new Node(main.dir().io.lang.violations.protections.infoNode.playerInfo);
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.name, p.getName());
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.uuid, p.getUniqueId().toString());
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.operator, p.isOp() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
+ playerInfo.addField(Component.text(main.dir().io.lang.violations.protections.infoNode.locationField), FormatUtils.formatLoc(p.getLocation()));
return playerInfo;
}
public static Node generateBlockInfo(Block block) {
- Node blockInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.blockInfo);
- blockInfo.addTextLine(Text.cleanName(block.getType().toString()));
- blockInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.worldField,block.getWorld().getName());
- blockInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.blockLocationField,Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.locationFormat.formatted(block.getX(), block.getY(), block.getZ()));
+ Node blockInfo = new Node(main.dir().io.lang.violations.protections.infoNode.blockInfo);
+ blockInfo.addTextLine(FormatUtils.formatType(block.getType().toString()));
+ blockInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.worldField,block.getWorld().getName());
+ blockInfo.addField(Component.text(main.dir().io.lang.violations.protections.infoNode.blockLocationField),FormatUtils.formatLoc(block.getLocation()));
return blockInfo;
}
public Node generateCommandBlockInfo(CommandBlock commandBlock) {
- Node commandBlockInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.blockInfo);
- commandBlockInfo.addTextLine(Text.cleanName(commandBlock.getType().toString()));
- commandBlockInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.worldField,commandBlock.getWorld().getName());
- commandBlockInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.blockLocationField,Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.locationFormat.formatted(commandBlock.getX(), commandBlock.getY(), commandBlock.getZ()));
+ Node commandBlockInfo = new Node(main.dir().io.lang.violations.protections.infoNode.blockInfo);
+ commandBlockInfo.addTextLine(FormatUtils.formatType(commandBlock.getType().toString()));
+ commandBlockInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.worldField,commandBlock.getWorld().getName());
+ commandBlockInfo.addField(Component.text(main.dir().io.lang.violations.protections.infoNode.blockLocationField), FormatUtils.formatLoc(commandBlock.getLocation()));
String command = commandBlock.getCommand();
if (command == null || command.isBlank()) {
return commandBlockInfo;
} else if (command.length() <= 128) {
- commandBlockInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandField, command);
+ commandBlockInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandField, command);
} else {
- commandBlockInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
+ commandBlockInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
}
return commandBlockInfo;
}
public Node generateMinecartInfo(CommandMinecart entity) {
- Node minecartInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.minecartInfo);
- minecartInfo.addTextLine(Text.cleanName(entity.getType().toString()));
- minecartInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.worldField,entity.getWorld().getName());
- minecartInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.cartLocationField,Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.locationFormat.formatted(Math.round(entity.getX()), Math.round(entity.getY()), Math.round(entity.getZ())));
+ Node minecartInfo = new Node(main.dir().io.lang.violations.protections.infoNode.minecartInfo);
+ minecartInfo.addTextLine(FormatUtils.formatType(entity.getType().toString()));
+ minecartInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.worldField,entity.getWorld().getName());
+ minecartInfo.addField(Component.text(main.dir().io.lang.violations.protections.infoNode.cartLocationField),FormatUtils.formatLoc(entity.getLocation()));
String command = entity.getCommand();
if (command == null || command.isBlank()) {
return minecartInfo;
} else if (command.length() <= 128) {
- minecartInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandField, command);
+ minecartInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandField, command);
} else {
- minecartInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
+ minecartInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
}
return minecartInfo;
}
public Node generateItemInfo(ItemStack item) {
- Node itemInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.itemInfo);
- itemInfo.addTextLine(Text.cleanName(item.getType().toString()));
- itemInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.hasMeta,item.hasItemMeta() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
+ Node itemInfo = new Node(main.dir().io.lang.violations.protections.infoNode.itemInfo);
+ itemInfo.addTextLine(FormatUtils.formatType(item.getType().toString()));
+ itemInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.hasMeta,item.hasItemMeta() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
if (item.hasItemMeta()) {
- itemInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.hasName,item.getItemMeta().hasCustomName() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
- itemInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.hasLore,item.getItemMeta().hasLore() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
- itemInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.hasAttributes,item.getItemMeta().hasAttributeModifiers() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
- itemInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.hasEnchants,item.getItemMeta().hasEnchants() ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
+ itemInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.hasName,item.getItemMeta().hasCustomName() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
+ itemInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.hasLore,item.getItemMeta().hasLore() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
+ itemInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.hasAttributes,item.getItemMeta().hasAttributeModifiers() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
+ itemInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.hasEnchants,item.getItemMeta().hasEnchants() ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
}
return itemInfo;
}
public Node generateCommandInfo(String command, Player executor) {
- Node commandInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandInfo);
+ Node commandInfo = new Node(main.dir().io.lang.violations.protections.infoNode.commandInfo);
String name = command.split(" ")[0].substring(1);
ServerUtils.verbose("Command Name: " + name);
Command executed = Bukkit.getServer().getCommandMap().getCommand(name);
- commandInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.name,name);
+ commandInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.name,name);
if (command.length() <= 128) {
- commandInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandField, command);
+ commandInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandField, command);
} else {
- commandInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
+ commandInfo.addField(main.dir().io.lang.violations.protections.infoNode.commandTooLargeField, FileUtils.createCommandLog(command));
}
if (executed == null || executed.getPermission() == null) return commandInfo;
- commandInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.permissionRequired,executed.getPermission());
- commandInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.permissionSatisfied,executor.hasPermission(executed.getPermission()) ? Sentinel.getInstance().getDirector().io.lang.generic.yes : Sentinel.getInstance().getDirector().io.lang.generic.no);
+ commandInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.permissionRequired,executed.getPermission());
+ commandInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.permissionSatisfied,executor.hasPermission(executed.getPermission()) ? main.dir().io.lang.generic.yes : main.dir().io.lang.generic.no);
return commandInfo;
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockBreak.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockBreak.java
index 773f437..a06aa52 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockBreak.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockBreak.java
@@ -1,16 +1,13 @@
package me.trouper.sentinel.server.events.violations.blocks.command;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
-import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.*;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.CommandBlock;
@@ -23,7 +20,7 @@ import org.bukkit.inventory.ItemStack;
import java.util.List;
-public class CommandBlockBreak extends AbstractViolation{
+public class CommandBlockBreak extends AbstractViolation {
@EventHandler
public void onBreak(BlockBreakEvent e) {
@@ -32,9 +29,9 @@ public class CommandBlockBreak extends AbstractViolation{
ServerUtils.verbose("CommandBlockBreak: Block is a command block");
Player p = e.getPlayer();
CommandBlock cb = (CommandBlock) b.getState();
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cb.getLocation());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cb.getLocation());
if (PlayerUtils.isTrusted(e.getPlayer())) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) {
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) {
ServerUtils.verbose("Auto Whitelist is on, un-whitelisting the command block.");
holder.setWhitelisted(false);
holder.delete();
@@ -42,7 +39,7 @@ public class CommandBlockBreak extends AbstractViolation{
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockBreak.enabled) {
ServerUtils.verbose("Not enabled, deletion allowed.");
if (!holder.isWhitelisted()) holder.delete();
return;
@@ -53,15 +50,14 @@ public class CommandBlockBreak extends AbstractViolation{
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.deop)
+ .deop(main.dir().io.violationConfig.commandBlockBreak.deop)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.logToDiscord);
-
+ .punish(main.dir().io.violationConfig.commandBlockBreak.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockBreak.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockBreak.logToDiscord);
+
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.brake, main.dir().io.lang.violations.protections.rootName.commandBlock),
generateCommandBlockInfo(cb),
config
);
@@ -70,7 +66,7 @@ public class CommandBlockBreak extends AbstractViolation{
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Break"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Break"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -87,7 +83,7 @@ public class CommandBlockBreak extends AbstractViolation{
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.enabled) {
+ if (main.dir().io.violationConfig.commandBlockBreak.enabled) {
ring = Items.GREEN;
}
@@ -98,11 +94,11 @@ public class CommandBlockBreak extends AbstractViolation{
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -111,36 +107,36 @@ public class CommandBlockBreak extends AbstractViolation{
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.enabled;
+ main.dir().io.violationConfig.commandBlockBreak.enabled = !main.dir().io.violationConfig.commandBlockBreak.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.deop;
+ main.dir().io.violationConfig.commandBlockBreak.deop = !main.dir().io.violationConfig.commandBlockBreak.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.logToDiscord;
+ main.dir().io.violationConfig.commandBlockBreak.logToDiscord = !main.dir().io.violationConfig.commandBlockBreak.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punish;
+ main.dir().io.violationConfig.commandBlockBreak.punish = !main.dir().io.violationConfig.commandBlockBreak.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockBreak.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockBreak.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockBreak.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockEdit.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockEdit.java
index 7093b7b..9d84062 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockEdit.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockEdit.java
@@ -7,8 +7,7 @@ import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.util.Vector3i;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientUpdateCommandBlock;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -16,6 +15,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -43,14 +43,14 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
Vector3i pos = wrapper.getPosition();
Location loc = new Location(p.getWorld(), pos.x, pos.y, pos.z);
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(loc);
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(loc);
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
holder.update(p,wrapper);
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockEdit.enabled) {
holder.update(p,wrapper);
return;
}
@@ -61,15 +61,14 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.deop)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.logToDiscord);
+ .deop(main.dir().io.violationConfig.commandBlockEdit.deop)
+ .punish(main.dir().io.violationConfig.commandBlockEdit.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockEdit.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockEdit.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.edit, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.edit, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.edit, main.dir().io.lang.violations.protections.rootName.commandBlock),
generateCommandBlockInfo((CommandBlock) holder.loc().translate().getBlock().getState()),
config
);
@@ -79,7 +78,7 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Edit"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Edit"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -96,7 +95,7 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.enabled) {
+ if (main.dir().io.violationConfig.commandBlockEdit.enabled) {
ring = Items.GREEN;
}
@@ -107,11 +106,11 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockEdit.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockEdit.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockEdit.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockEdit.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockEdit.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -120,36 +119,36 @@ public class CommandBlockEdit extends AbstractViolation implements PacketListene
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.enabled;
+ main.dir().io.violationConfig.commandBlockEdit.enabled = !main.dir().io.violationConfig.commandBlockEdit.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.deop;
+ main.dir().io.violationConfig.commandBlockEdit.deop = !main.dir().io.violationConfig.commandBlockEdit.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.logToDiscord;
+ main.dir().io.violationConfig.commandBlockEdit.logToDiscord = !main.dir().io.violationConfig.commandBlockEdit.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punish;
+ main.dir().io.violationConfig.commandBlockEdit.punish = !main.dir().io.violationConfig.commandBlockEdit.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockEdit.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockEdit.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockEdit.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockEdit.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockPlace.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockPlace.java
index 5b5b8be..ea993dc 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockPlace.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockPlace.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.blocks.command;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -31,14 +31,14 @@ public class CommandBlockPlace extends AbstractViolation {
Block b = e.getBlockPlaced();
if (!ServerUtils.isCommandBlock(b)) return;
CommandBlock cb = (CommandBlock) b.getState();
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.generateHolder(p.getUniqueId(),cb);
+ CommandBlockHolder holder = main.dir().whitelistManager.generateHolder(p.getUniqueId(),cb);
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.addAndWhitelist();
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.addAndWhitelist();
holder.add();
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) {
holder.add();
return;
}
@@ -48,16 +48,15 @@ public class CommandBlockPlace extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.deop)
+ .deop(main.dir().io.violationConfig.commandBlockPlace.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandBlockPlace.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockPlace.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockPlace.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.place, main.dir().io.lang.violations.protections.rootName.commandBlock),
generateCommandBlockInfo(cb),
config
);
@@ -66,7 +65,7 @@ public class CommandBlockPlace extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Place"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Place"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -83,7 +82,7 @@ public class CommandBlockPlace extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) {
+ if (main.dir().io.violationConfig.commandBlockPlace.enabled) {
ring = Items.GREEN;
}
@@ -94,11 +93,11 @@ public class CommandBlockPlace extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockPlace.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -107,36 +106,36 @@ public class CommandBlockPlace extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled;
+ main.dir().io.violationConfig.commandBlockPlace.enabled = !main.dir().io.violationConfig.commandBlockPlace.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.deop;
+ main.dir().io.violationConfig.commandBlockPlace.deop = !main.dir().io.violationConfig.commandBlockPlace.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.logToDiscord;
+ main.dir().io.violationConfig.commandBlockPlace.logToDiscord = !main.dir().io.violationConfig.commandBlockPlace.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punish;
+ main.dir().io.violationConfig.commandBlockPlace.punish = !main.dir().io.violationConfig.commandBlockPlace.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockPlace.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockPlace.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockPlace.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockUse.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockUse.java
index 4b16086..2ce6d75 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockUse.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/command/CommandBlockUse.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.blocks.command;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -33,14 +33,19 @@ public class CommandBlockUse extends AbstractViolation {
Block b = e.getClickedBlock();
if (!(ServerUtils.isCommandBlock(b))) return;
CommandBlock cb = (CommandBlock) b.getState();
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cb.getLocation());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cb.getLocation());
+ if (holder == null) {
+ holder = main.dir().whitelistManager.generateHolder(p.getUniqueId(),cb);
+ holder.add();
+ }
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
+
holder.update(p);
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockUse.enabled) {
holder.update(p);
return;
}
@@ -50,15 +55,14 @@ public class CommandBlockUse extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.deop)
+ .deop(main.dir().io.violationConfig.commandBlockUse.deop)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandBlockUse.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockUse.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockUse.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.use, main.dir().io.lang.violations.protections.rootName.commandBlock),
generateCommandBlockInfo(cb),
config
);
@@ -67,7 +71,7 @@ public class CommandBlockUse extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Use"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Use"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -84,7 +88,7 @@ public class CommandBlockUse extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled) {
+ if (main.dir().io.violationConfig.commandBlockUse.enabled) {
ring = Items.GREEN;
}
@@ -95,11 +99,11 @@ public class CommandBlockUse extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockUse.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -108,36 +112,36 @@ public class CommandBlockUse extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled;
+ main.dir().io.violationConfig.commandBlockUse.enabled = !main.dir().io.violationConfig.commandBlockUse.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.deop;
+ main.dir().io.violationConfig.commandBlockUse.deop = !main.dir().io.violationConfig.commandBlockUse.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.logToDiscord;
+ main.dir().io.violationConfig.commandBlockUse.logToDiscord = !main.dir().io.violationConfig.commandBlockUse.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punish;
+ main.dir().io.violationConfig.commandBlockUse.punish = !main.dir().io.violationConfig.commandBlockUse.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockUse.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockUse.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockUse.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockBreak.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockBreak.java
index 90f67ed..4f6712e 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockBreak.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockBreak.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -25,7 +26,7 @@ public class JigsawBlockBreak extends AbstractViolation {
@EventHandler
public void onPlace(BlockBreakEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getBlock();
if (b == null) return;
@@ -38,16 +39,15 @@ public class JigsawBlockBreak extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.deop)
+ .deop(main.dir().io.violationConfig.jigsawBlockBreak.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.logToDiscord);
+ .punish(main.dir().io.violationConfig.jigsawBlockBreak.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.jigsawBlockBreak.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.jigsawBlockBreak.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.brake, main.dir().io.lang.violations.protections.rootName.jigsawBlock),
generateBlockInfo(b),
config
);
@@ -56,7 +56,7 @@ public class JigsawBlockBreak extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Jigsaw Block Break"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Jigsaw Block Break"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -73,7 +73,7 @@ public class JigsawBlockBreak extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.enabled) {
+ if (main.dir().io.violationConfig.jigsawBlockBreak.enabled) {
ring = Items.GREEN;
}
@@ -84,11 +84,11 @@ public class JigsawBlockBreak extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.jigsawBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -97,36 +97,36 @@ public class JigsawBlockBreak extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.enabled;
+ main.dir().io.violationConfig.jigsawBlockBreak.enabled = !main.dir().io.violationConfig.jigsawBlockBreak.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.deop = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.deop;
+ main.dir().io.violationConfig.jigsawBlockBreak.deop = !main.dir().io.violationConfig.jigsawBlockBreak.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.logToDiscord;
+ main.dir().io.violationConfig.jigsawBlockBreak.logToDiscord = !main.dir().io.violationConfig.jigsawBlockBreak.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punish = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punish;
+ main.dir().io.violationConfig.jigsawBlockBreak.punish = !main.dir().io.violationConfig.jigsawBlockBreak.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.jigsawBlockBreak.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punishmentCommands);
+ },"" + main.dir().io.violationConfig.jigsawBlockBreak.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockBreak.punishmentCommands.clear();
+ main.dir().io.violationConfig.jigsawBlockBreak.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockPlace.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockPlace.java
index 8a2db17..bded2c5 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockPlace.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockPlace.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -25,7 +26,7 @@ public class JigsawBlockPlace extends AbstractViolation {
@EventHandler
public void onPlace(BlockPlaceEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getBlockPlaced();
if (b == null) return;
@@ -38,16 +39,15 @@ public class JigsawBlockPlace extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.deop)
+ .deop(main.dir().io.violationConfig.jigsawBlockPlace.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.logToDiscord);
+ .punish(main.dir().io.violationConfig.jigsawBlockPlace.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.jigsawBlockPlace.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.jigsawBlockPlace.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.place, main.dir().io.lang.violations.protections.rootName.jigsawBlock),
generateBlockInfo(b),
config
);
@@ -56,7 +56,7 @@ public class JigsawBlockPlace extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Jigsaw Block Place"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Jigsaw Block Place"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -73,7 +73,7 @@ public class JigsawBlockPlace extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.enabled) {
+ if (main.dir().io.violationConfig.jigsawBlockPlace.enabled) {
ring = Items.GREEN;
}
@@ -84,11 +84,11 @@ public class JigsawBlockPlace extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockPlace.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.jigsawBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -97,36 +97,36 @@ public class JigsawBlockPlace extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.enabled;
+ main.dir().io.violationConfig.jigsawBlockPlace.enabled = !main.dir().io.violationConfig.jigsawBlockPlace.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.deop = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.deop;
+ main.dir().io.violationConfig.jigsawBlockPlace.deop = !main.dir().io.violationConfig.jigsawBlockPlace.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.logToDiscord;
+ main.dir().io.violationConfig.jigsawBlockPlace.logToDiscord = !main.dir().io.violationConfig.jigsawBlockPlace.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punish = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punish;
+ main.dir().io.violationConfig.jigsawBlockPlace.punish = !main.dir().io.violationConfig.jigsawBlockPlace.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.jigsawBlockPlace.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punishmentCommands);
+ },"" + main.dir().io.violationConfig.jigsawBlockPlace.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockPlace.punishmentCommands.clear();
+ main.dir().io.violationConfig.jigsawBlockPlace.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockUse.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockUse.java
index f3318b5..681eeee 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockUse.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/jigsaw/JigsawBlockUse.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -24,7 +25,7 @@ import java.util.List;
public class JigsawBlockUse extends AbstractViolation {
@EventHandler
public void onPlace(PlayerInteractEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getClickedBlock();
if (b == null) return;
@@ -37,16 +38,15 @@ public class JigsawBlockUse extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.deop)
+ .deop(main.dir().io.violationConfig.jigsawBlockUse.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.logToDiscord);
+ .punish(main.dir().io.violationConfig.jigsawBlockUse.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.jigsawBlockUse.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.jigsawBlockUse.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.jigsawBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.use, main.dir().io.lang.violations.protections.rootName.jigsawBlock),
generateBlockInfo(b),
config
);
@@ -55,7 +55,7 @@ public class JigsawBlockUse extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Jigsaw Block Use"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Jigsaw Block Use"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -72,7 +72,7 @@ public class JigsawBlockUse extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.enabled) {
+ if (main.dir().io.violationConfig.jigsawBlockUse.enabled) {
ring = Items.GREEN;
}
@@ -83,11 +83,11 @@ public class JigsawBlockUse extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockUse.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.jigsawBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.jigsawBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -96,36 +96,36 @@ public class JigsawBlockUse extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.enabled;
+ main.dir().io.violationConfig.jigsawBlockUse.enabled = !main.dir().io.violationConfig.jigsawBlockUse.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.deop = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.deop;
+ main.dir().io.violationConfig.jigsawBlockUse.deop = !main.dir().io.violationConfig.jigsawBlockUse.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.logToDiscord;
+ main.dir().io.violationConfig.jigsawBlockUse.logToDiscord = !main.dir().io.violationConfig.jigsawBlockUse.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punish = !Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punish;
+ main.dir().io.violationConfig.jigsawBlockUse.punish = !main.dir().io.violationConfig.jigsawBlockUse.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.jigsawBlockUse.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punishmentCommands);
+ },"" + main.dir().io.violationConfig.jigsawBlockUse.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.jigsawBlockUse.punishmentCommands.clear();
+ main.dir().io.violationConfig.jigsawBlockUse.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockBreak.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockBreak.java
index 8dd9aef..475c00c 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockBreak.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockBreak.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -25,7 +26,7 @@ public class StructureBlockBreak extends AbstractViolation {
@EventHandler
public void onPlace(BlockBreakEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getBlock();
if (b == null) return;
@@ -38,16 +39,15 @@ public class StructureBlockBreak extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.deop)
+ .deop(main.dir().io.violationConfig.structureBlockBreak.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.logToDiscord);
+ .punish(main.dir().io.violationConfig.structureBlockBreak.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.structureBlockBreak.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.structureBlockBreak.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.brake, main.dir().io.lang.violations.protections.rootName.structureBlock),
generateBlockInfo(b),
config
);
@@ -57,7 +57,7 @@ public class StructureBlockBreak extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Structure Block Break"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Structure Block Break"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -74,7 +74,7 @@ public class StructureBlockBreak extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.enabled) {
+ if (main.dir().io.violationConfig.structureBlockBreak.enabled) {
ring = Items.GREEN;
}
@@ -85,11 +85,11 @@ public class StructureBlockBreak extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.structureBlockBreak.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.structureBlockBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.structureBlockBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.structureBlockBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.structureBlockBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -98,36 +98,36 @@ public class StructureBlockBreak extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.enabled;
+ main.dir().io.violationConfig.structureBlockBreak.enabled = !main.dir().io.violationConfig.structureBlockBreak.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.deop = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.deop;
+ main.dir().io.violationConfig.structureBlockBreak.deop = !main.dir().io.violationConfig.structureBlockBreak.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.logToDiscord;
+ main.dir().io.violationConfig.structureBlockBreak.logToDiscord = !main.dir().io.violationConfig.structureBlockBreak.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punish = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punish;
+ main.dir().io.violationConfig.structureBlockBreak.punish = !main.dir().io.violationConfig.structureBlockBreak.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.structureBlockBreak.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punishmentCommands);
+ },"" + main.dir().io.violationConfig.structureBlockBreak.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockBreak.punishmentCommands.clear();
+ main.dir().io.violationConfig.structureBlockBreak.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockPlace.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockPlace.java
index 9b90594..5e2083a 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockPlace.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockPlace.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -24,7 +25,7 @@ import java.util.List;
public class StructureBlockPlace extends AbstractViolation {
@EventHandler
public void onPlace(BlockPlaceEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getBlockPlaced();
if (b == null) return;
@@ -37,16 +38,15 @@ public class StructureBlockPlace extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.deop)
+ .deop(main.dir().io.violationConfig.structureBlockPlace.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.logToDiscord);
+ .punish(main.dir().io.violationConfig.structureBlockPlace.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.structureBlockPlace.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.structureBlockPlace.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.place, main.dir().io.lang.violations.protections.rootName.structureBlock),
generateBlockInfo(b),
config
);
@@ -55,7 +55,7 @@ public class StructureBlockPlace extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Structure Block Place"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Structure Block Place"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -72,7 +72,7 @@ public class StructureBlockPlace extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.enabled) {
+ if (main.dir().io.violationConfig.structureBlockPlace.enabled) {
ring = Items.GREEN;
}
@@ -83,11 +83,11 @@ public class StructureBlockPlace extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.structureBlockPlace.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.structureBlockPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.structureBlockPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.structureBlockPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.structureBlockPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -96,36 +96,36 @@ public class StructureBlockPlace extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.enabled;
+ main.dir().io.violationConfig.structureBlockPlace.enabled = !main.dir().io.violationConfig.structureBlockPlace.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.deop = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.deop;
+ main.dir().io.violationConfig.structureBlockPlace.deop = !main.dir().io.violationConfig.structureBlockPlace.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.logToDiscord;
+ main.dir().io.violationConfig.structureBlockPlace.logToDiscord = !main.dir().io.violationConfig.structureBlockPlace.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punish = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punish;
+ main.dir().io.violationConfig.structureBlockPlace.punish = !main.dir().io.violationConfig.structureBlockPlace.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.structureBlockPlace.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punishmentCommands);
+ },"" + main.dir().io.violationConfig.structureBlockPlace.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockPlace.punishmentCommands.clear();
+ main.dir().io.violationConfig.structureBlockPlace.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockUse.java b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockUse.java
index 876f4fe..e47b7b2 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockUse.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/blocks/structure/StructureBlockUse.java
@@ -9,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -24,7 +25,7 @@ import java.util.List;
public class StructureBlockUse extends AbstractViolation {
@EventHandler
public void onPlace(PlayerInteractEvent e) {
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockPlace.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockPlace.enabled) return;
Player p = e.getPlayer();
Block b = e.getClickedBlock();
if (b == null) return;
@@ -38,16 +39,15 @@ public class StructureBlockUse extends AbstractViolation {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.deop)
+ .deop(main.dir().io.violationConfig.structureBlockUse.deop)
.cancel(true)
.setEvent(e)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.logToDiscord);
+ .punish(main.dir().io.violationConfig.structureBlockUse.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.structureBlockUse.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.structureBlockUse.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.structureBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.use, main.dir().io.lang.violations.protections.rootName.structureBlock),
generateBlockInfo(b),
config
);
@@ -56,7 +56,7 @@ public class StructureBlockUse extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Structure Block Use"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Structure Block Use"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -73,7 +73,7 @@ public class StructureBlockUse extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.enabled) {
+ if (main.dir().io.violationConfig.structureBlockUse.enabled) {
ring = Items.GREEN;
}
@@ -84,11 +84,11 @@ public class StructureBlockUse extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.structureBlockUse.enabled,Items.configItem("Check Toggle",Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.structureBlockUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.structureBlockUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.structureBlockUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.structureBlockUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -97,36 +97,36 @@ public class StructureBlockUse extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.enabled;
+ main.dir().io.violationConfig.structureBlockUse.enabled = !main.dir().io.violationConfig.structureBlockUse.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.deop = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.deop;
+ main.dir().io.violationConfig.structureBlockUse.deop = !main.dir().io.violationConfig.structureBlockUse.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.logToDiscord;
+ main.dir().io.violationConfig.structureBlockUse.logToDiscord = !main.dir().io.violationConfig.structureBlockUse.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punish = !Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punish;
+ main.dir().io.violationConfig.structureBlockUse.punish = !main.dir().io.violationConfig.structureBlockUse.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.structureBlockUse.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punishmentCommands);
+ },"" + main.dir().io.violationConfig.structureBlockUse.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.structureBlockUse.punishmentCommands.clear();
+ main.dir().io.violationConfig.structureBlockUse.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/command/DangerousCommand.java b/src/main/java/me/trouper/sentinel/server/events/violations/command/DangerousCommand.java
index 48f15da..5da3076 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/command/DangerousCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/command/DangerousCommand.java
@@ -8,6 +8,7 @@ import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -27,20 +28,19 @@ public class DangerousCommand extends AbstractViolation {
String label = e.getMessage().substring(1).split(" ")[0];
String args = e.getMessage();
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.commands.contains(label) && Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.enabled) {
+ if (main.dir().io.violationConfig.commandExecute.dangerous.commands.contains(label) && main.dir().io.violationConfig.commandExecute.dangerous.enabled) {
e.setCancelled(true);
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.deop)
+ .deop(main.dir().io.violationConfig.commandExecute.dangerous.deop)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandExecute.dangerous.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandExecute.dangerous.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandExecute.dangerous.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.dangerousCommand),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.dangerousCommand),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.run, main.dir().io.lang.violations.protections.rootName.dangerousCommand),
generateCommandInfo(args, p),
config
);
@@ -50,7 +50,7 @@ public class DangerousCommand extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Dangerous Command Check"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Dangerous Command Check"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -67,7 +67,7 @@ public class DangerousCommand extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.enabled) {
+ if (main.dir().io.violationConfig.commandExecute.dangerous.enabled) {
ring = Items.GREEN;
}
@@ -78,12 +78,12 @@ public class DangerousCommand extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
- inv.setItem(22,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.commands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands that will flag this check."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandExecute.dangerous.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandExecute.dangerous.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandExecute.dangerous.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandExecute.dangerous.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandExecute.dangerous.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(22,Items.stringListItem(main.dir().io.violationConfig.commandExecute.dangerous.commands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands that will flag this check."));
}
@Override
@@ -92,48 +92,48 @@ public class DangerousCommand extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.enabled;
+ main.dir().io.violationConfig.commandExecute.dangerous.enabled = !main.dir().io.violationConfig.commandExecute.dangerous.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.deop;
+ main.dir().io.violationConfig.commandExecute.dangerous.deop = !main.dir().io.violationConfig.commandExecute.dangerous.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.logToDiscord;
+ main.dir().io.violationConfig.commandExecute.dangerous.logToDiscord = !main.dir().io.violationConfig.commandExecute.dangerous.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punish;
+ main.dir().io.violationConfig.commandExecute.dangerous.punish = !main.dir().io.violationConfig.commandExecute.dangerous.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.commandExecute.dangerous.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandExecute.dangerous.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandExecute.dangerous.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 22 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.commandExecute.dangerous.commands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.commands);
+ },"" + main.dir().io.violationConfig.commandExecute.dangerous.commands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.dangerous.commands.clear();
+ main.dir().io.violationConfig.commandExecute.dangerous.commands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/command/HiddenCommand.java b/src/main/java/me/trouper/sentinel/server/events/violations/command/HiddenCommand.java
deleted file mode 100644
index 403f23c..0000000
--- a/src/main/java/me/trouper/sentinel/server/events/violations/command/HiddenCommand.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package me.trouper.sentinel.server.events.violations.command;
-
-import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.server.events.violations.AbstractViolation;
-import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
-import me.trouper.sentinel.utils.trees.Node;
-import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
-import org.bukkit.entity.Player;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.inventory.InventoryClickEvent;
-import org.bukkit.inventory.Inventory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class HiddenCommand extends AbstractViolation {
- // Track recent canceled messages per player
- private static final Map> canceledMessages = new ConcurrentHashMap<>();
- private static final int THRESHOLD = 3; // Minimum messages to trigger detection
- private static final int CHECK_LENGTH = 2; // Check first N characters for similarity
-
- @EventHandler(priority = EventPriority.MONITOR)
- public void onChat(AsyncChatEvent event) {
- if (!event.isCancelled()) return;
-
- Player player = event.getPlayer();
- String message = LegacyComponentSerializer.legacySection().serialize(event.message());
- UUID uuid = player.getUniqueId();
-
- // Add message to player's history
- canceledMessages.compute(uuid, (k, v) -> {
- if (v == null) v = new ArrayList<>();
- v.add(message);
- return v;
- });
-
- // Check if threshold is met
- List messages = canceledMessages.get(uuid);
- if (messages.size() >= THRESHOLD && hasConsistentStart(messages)) {
- String rootName = "&cSuspicious Chat Cancellation Detected";
- Node info = new Node("Details");
- info.addKeyValue("Pattern", messages.get(0).substring(0, CHECK_LENGTH) + "*");
- info.addKeyValue("Count", String.valueOf(messages.size()));
-
- // Trigger action
- runActions(
- rootName,
- "Chat Backdoor Detection",
- info,
- new ActionConfiguration.Builder()
- .setPlayer(player)
- .logToDiscord(true)
- );
-
- // Reset tracking
- canceledMessages.remove(uuid);
- }
- }
-
- private boolean hasConsistentStart(List messages) {
- if (messages.size() < THRESHOLD) return false;
- String prefix = messages.get(0).substring(0, Math.min(CHECK_LENGTH, messages.get(0).length()));
- return messages.stream()
- .allMatch(msg -> msg.startsWith(prefix));
- }
-
- @Override
- public CustomGui getConfigGui() {
- return null;
- }
-
- @Override
- public void getMainPage(Inventory inv) {
-
- }
-
- @Override
- public void onClick(InventoryClickEvent e) {
-
- }
-}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/command/LoggedCommand.java b/src/main/java/me/trouper/sentinel/server/events/violations/command/LoggedCommand.java
index e6b839e..c062e04 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/command/LoggedCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/command/LoggedCommand.java
@@ -8,6 +8,7 @@ import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -28,14 +29,13 @@ public class LoggedCommand extends AbstractViolation {
String label = e.getMessage().substring(1).split(" ")[0];
String args = e.getMessage();
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.commands.contains(label) && Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.enabled) {
+ if (main.dir().io.violationConfig.commandExecute.logged.commands.contains(label) && main.dir().io.violationConfig.commandExecute.logged.enabled) {
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setPlayer(p)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.logToDiscord);
+ .logToDiscord(main.dir().io.violationConfig.commandExecute.logged.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.loggedCommand),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.loggedCommand),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.run, main.dir().io.lang.violations.protections.rootName.loggedCommand),
generateCommandInfo(args, p),
config
);
@@ -46,7 +46,7 @@ public class LoggedCommand extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Logged Command Check"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Logged Command Check"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -63,7 +63,7 @@ public class LoggedCommand extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.enabled) {
+ if (main.dir().io.violationConfig.commandExecute.logged.enabled) {
ring = Items.GREEN;
}
@@ -74,9 +74,9 @@ public class LoggedCommand extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(11,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.logToDiscord,Items.configItem("Log to Discord",Material.OAK_LOG,"If this check will log to discord")));
- inv.setItem(15,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.commands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands that will flag this check"));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandExecute.logged.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(11,Items.booleanItem(main.dir().io.violationConfig.commandExecute.logged.logToDiscord,Items.configItem("Log to Discord",Material.OAK_LOG,"If this check will log to discord")));
+ inv.setItem(15,Items.stringListItem(main.dir().io.violationConfig.commandExecute.logged.commands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands that will flag this check"));
}
@Override
@@ -85,25 +85,25 @@ public class LoggedCommand extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.enabled;
+ main.dir().io.violationConfig.commandExecute.logged.enabled = !main.dir().io.violationConfig.commandExecute.logged.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 11 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.logToDiscord;
+ main.dir().io.violationConfig.commandExecute.logged.logToDiscord = !main.dir().io.violationConfig.commandExecute.logged.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 15 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.commandExecute.logged.commands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.commands);
+ },"" + main.dir().io.violationConfig.commandExecute.logged.commands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.logged.commands.clear();
+ main.dir().io.violationConfig.commandExecute.logged.commands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/command/SpecificCommand.java b/src/main/java/me/trouper/sentinel/server/events/violations/command/SpecificCommand.java
index 3adc88a..40e4354 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/command/SpecificCommand.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/command/SpecificCommand.java
@@ -8,6 +8,7 @@ import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -26,19 +27,18 @@ public class SpecificCommand extends AbstractViolation {
String label = e.getMessage().substring(1).split(" ")[0];
String args = e.getMessage();
- if (label.contains(":") && Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.enabled) {
+ if (label.contains(":") && main.dir().io.violationConfig.commandExecute.specific.enabled) {
e.setCancelled(true);
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandExecute.specific.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandExecute.specific.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandExecute.specific.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.specificCommand),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.run, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.specificCommand),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.run, main.dir().io.lang.violations.protections.rootName.specificCommand),
generateCommandInfo(args, p),
config
);
@@ -48,7 +48,7 @@ public class SpecificCommand extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Specific Command Check"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Specific Command Check"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -65,7 +65,7 @@ public class SpecificCommand extends AbstractViolation {
}
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.enabled) {
+ if (main.dir().io.violationConfig.commandExecute.specific.enabled) {
top = Items.GREEN;
}
@@ -74,10 +74,10 @@ public class SpecificCommand extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(4,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(11,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"If this check will run the punishment commands")));
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(15,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punishmentCommands,Material.DIAMOND_AXE,"Commands","Commands that will flag this check"));
+ inv.setItem(4,Items.booleanItem(main.dir().io.violationConfig.commandExecute.specific.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(11,Items.booleanItem(main.dir().io.violationConfig.commandExecute.specific.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"If this check will run the punishment commands")));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandExecute.specific.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(15,Items.stringListItem(main.dir().io.violationConfig.commandExecute.specific.punishmentCommands,Material.DIAMOND_AXE,"Commands","Commands that will flag this check"));
}
@Override
@@ -86,31 +86,31 @@ public class SpecificCommand extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 4 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.enabled;
+ main.dir().io.violationConfig.commandExecute.specific.enabled = !main.dir().io.violationConfig.commandExecute.specific.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.logToDiscord;
+ main.dir().io.violationConfig.commandExecute.specific.logToDiscord = !main.dir().io.violationConfig.commandExecute.specific.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 11 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punish;
+ main.dir().io.violationConfig.commandExecute.specific.punish = !main.dir().io.violationConfig.commandExecute.specific.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 15 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandExecute.specific.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandExecute.specific.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandExecute.specific.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandExecute.specific.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartBreak.java b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartBreak.java
index 957cbb0..68ed3c4 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartBreak.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartBreak.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.entities;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -35,9 +35,9 @@ public class CommandMinecartBreak extends AbstractViolation {
return;
}
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cm.getUniqueId());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cm.getUniqueId());
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) {
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) {
ServerUtils.verbose("Auto Whitelist is on, un-whitelisting the command minecart.");
holder.setWhitelisted(false);
holder.delete();
@@ -45,7 +45,7 @@ public class CommandMinecartBreak extends AbstractViolation {
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockMinecartBreak.enabled) {
ServerUtils.verbose("Not enabled, deletion allowed.");
if (!holder.isWhitelisted()) holder.delete();
return;
@@ -58,15 +58,14 @@ public class CommandMinecartBreak extends AbstractViolation {
.setEvent(e)
.setEntity(cm)
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.deop)
+ .deop(main.dir().io.violationConfig.commandBlockBreak.deop)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockBreak.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandBlockBreak.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockBreak.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockBreak.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.brake, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.brake, main.dir().io.lang.violations.protections.rootName.commandMinecart),
generateMinecartInfo(cm),
config
);
@@ -75,7 +74,7 @@ public class CommandMinecartBreak extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Cart Break"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Cart Break"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -92,7 +91,7 @@ public class CommandMinecartBreak extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.enabled) {
+ if (main.dir().io.violationConfig.commandBlockMinecartBreak.enabled) {
ring = Items.GREEN;
}
@@ -103,11 +102,11 @@ public class CommandMinecartBreak extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartBreak.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartBreak.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartBreak.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartBreak.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockMinecartBreak.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -116,36 +115,36 @@ public class CommandMinecartBreak extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.enabled;
+ main.dir().io.violationConfig.commandBlockMinecartBreak.enabled = !main.dir().io.violationConfig.commandBlockMinecartBreak.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.deop;
+ main.dir().io.violationConfig.commandBlockMinecartBreak.deop = !main.dir().io.violationConfig.commandBlockMinecartBreak.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.logToDiscord;
+ main.dir().io.violationConfig.commandBlockMinecartBreak.logToDiscord = !main.dir().io.violationConfig.commandBlockMinecartBreak.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punish;
+ main.dir().io.violationConfig.commandBlockMinecartBreak.punish = !main.dir().io.violationConfig.commandBlockMinecartBreak.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockMinecartBreak.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockMinecartBreak.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartBreak.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockMinecartBreak.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartEdit.java b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartEdit.java
index c50c0db..d51e369 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartEdit.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartEdit.java
@@ -6,8 +6,7 @@ import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientUpdateCommandBlockMinecart;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -15,6 +14,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@@ -45,14 +45,14 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
return;
}
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cart.getUniqueId());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cart.getUniqueId());
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
holder.update(p,wrapper);
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockMinecartEdit.enabled) {
holder.update(p,wrapper);
return;
}
@@ -63,15 +63,14 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setPlayer(p)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.deop)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punish)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.logToDiscord);
+ .deop(main.dir().io.violationConfig.commandBlockMinecartEdit.deop)
+ .punish(main.dir().io.violationConfig.commandBlockMinecartEdit.punish)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockMinecartEdit.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockMinecartEdit.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.edit, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.edit, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlock),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.edit, main.dir().io.lang.violations.protections.rootName.commandBlock),
generateMinecartInfo(cart),
config
);
@@ -89,7 +88,7 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Edit"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Edit"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -106,7 +105,7 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.enabled) {
+ if (main.dir().io.violationConfig.commandBlockMinecartEdit.enabled) {
ring = Items.GREEN;
}
@@ -117,11 +116,11 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartEdit.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartEdit.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartEdit.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartEdit.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockMinecartEdit.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -130,36 +129,36 @@ public class CommandMinecartEdit extends AbstractViolation implements PacketList
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.enabled;
+ main.dir().io.violationConfig.commandBlockMinecartEdit.enabled = !main.dir().io.violationConfig.commandBlockMinecartEdit.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.deop;
+ main.dir().io.violationConfig.commandBlockMinecartEdit.deop = !main.dir().io.violationConfig.commandBlockMinecartEdit.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.logToDiscord;
+ main.dir().io.violationConfig.commandBlockMinecartEdit.logToDiscord = !main.dir().io.violationConfig.commandBlockMinecartEdit.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punish;
+ main.dir().io.violationConfig.commandBlockMinecartEdit.punish = !main.dir().io.violationConfig.commandBlockMinecartEdit.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockMinecartEdit.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockMinecartEdit.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartEdit.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockMinecartEdit.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartPlace.java b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartPlace.java
index 8953727..ee10736 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartPlace.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartPlace.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.entities;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -53,7 +53,7 @@ public class CommandMinecartPlace extends AbstractViolation {
private void onVehicleCreate(VehicleCreateEvent e) {
//ServerUtils.verbose("Vehicle Creation Event");
if (!(e.getVehicle() instanceof CommandMinecart cm)) return;
- if (queuedInteractions.isEmpty()) {
+ if (queuedInteractions.isEmpty() ) {
ServerUtils.verbose("Queue is empty, preventing");
e.setCancelled(true);
return;
@@ -70,14 +70,14 @@ public class CommandMinecartPlace extends AbstractViolation {
e.setCancelled(true);
return;
}
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.generateHolder(p.getUniqueId(),cm);
+ CommandBlockHolder holder = main.dir().whitelistManager.generateHolder(p.getUniqueId(),cm);
if (PlayerUtils.isTrusted(p)) {
- if (!Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.addAndWhitelist();
+ if (!main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.addAndWhitelist();
holder.add();
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockMinecartPlace.enabled) {
holder.add();
return;
}
@@ -86,17 +86,16 @@ public class CommandMinecartPlace extends AbstractViolation {
.setEvent(e)
.setPlayer(p)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punish)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.deop)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandBlockMinecartPlace.punish)
+ .deop(main.dir().io.violationConfig.commandBlockMinecartPlace.deop)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockMinecartPlace.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockMinecartPlace.logToDiscord);
// Remove the command block minecart from the player's inventory
p.getInventory().remove(Material.COMMAND_BLOCK_MINECART);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.place, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.place, main.dir().io.lang.violations.protections.rootName.commandMinecart),
generateMinecartInfo(cm),
config
);
@@ -122,7 +121,7 @@ public class CommandMinecartPlace extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Cart Place"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Cart Place"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -139,7 +138,7 @@ public class CommandMinecartPlace extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.enabled) {
+ if (main.dir().io.violationConfig.commandBlockMinecartPlace.enabled) {
ring = Items.GREEN;
}
@@ -150,11 +149,11 @@ public class CommandMinecartPlace extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartPlace.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartPlace.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartPlace.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartPlace.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockMinecartPlace.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -163,36 +162,36 @@ public class CommandMinecartPlace extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.enabled;
+ main.dir().io.violationConfig.commandBlockMinecartPlace.enabled = !main.dir().io.violationConfig.commandBlockMinecartPlace.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.deop;
+ main.dir().io.violationConfig.commandBlockMinecartPlace.deop = !main.dir().io.violationConfig.commandBlockMinecartPlace.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.logToDiscord;
+ main.dir().io.violationConfig.commandBlockMinecartPlace.logToDiscord = !main.dir().io.violationConfig.commandBlockMinecartPlace.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punish;
+ main.dir().io.violationConfig.commandBlockMinecartPlace.punish = !main.dir().io.violationConfig.commandBlockMinecartPlace.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockMinecartPlace.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockMinecartPlace.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartPlace.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockMinecartPlace.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartUse.java b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartUse.java
index 4e629c6..4c72985 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartUse.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/entities/CommandMinecartUse.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.entities;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -30,15 +30,15 @@ public class CommandMinecartUse extends AbstractViolation {
if (!(e.getRightClicked() instanceof CommandMinecart cm)) return;
ServerUtils.verbose("MinecartCommandUse: Entity is minecart command");
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cm.getUniqueId());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cm.getUniqueId());
if (PlayerUtils.isTrusted(p)) {
- if (Sentinel.getInstance().getDirector().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
+ if (main.dir().whitelistManager.autoWhitelist.contains(p.getUniqueId())) holder.setWhitelisted(true);
holder.update(p);
e.setCancelled(true);
return;
}
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockUse.enabled) {
+ if (!main.dir().io.violationConfig.commandBlockUse.enabled) {
holder.update(p);
return;
}
@@ -48,14 +48,13 @@ public class CommandMinecartUse extends AbstractViolation {
.setPlayer(p)
.setEntity(cm)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punish)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.deop)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.logToDiscord);
+ .punish(main.dir().io.violationConfig.commandBlockMinecartUse.punish)
+ .deop(main.dir().io.violationConfig.commandBlockMinecartUse.deop)
+ .setPunishmentCommands(main.dir().io.violationConfig.commandBlockMinecartUse.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockMinecartUse.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.use, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandMinecart),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.use, main.dir().io.lang.violations.protections.rootName.commandMinecart),
generateMinecartInfo(cm),
config
);
@@ -64,7 +63,7 @@ public class CommandMinecartUse extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Cart Use"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Cart Use"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -81,7 +80,7 @@ public class CommandMinecartUse extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.enabled) {
+ if (main.dir().io.violationConfig.commandBlockMinecartUse.enabled) {
ring = Items.GREEN;
}
@@ -92,11 +91,11 @@ public class CommandMinecartUse extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartUse.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartUse.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartUse.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.commandBlockMinecartUse.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.commandBlockMinecartUse.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -105,36 +104,36 @@ public class CommandMinecartUse extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.enabled;
+ main.dir().io.violationConfig.commandBlockMinecartUse.enabled = !main.dir().io.violationConfig.commandBlockMinecartUse.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.deop = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.deop;
+ main.dir().io.violationConfig.commandBlockMinecartUse.deop = !main.dir().io.violationConfig.commandBlockMinecartUse.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.logToDiscord;
+ main.dir().io.violationConfig.commandBlockMinecartUse.logToDiscord = !main.dir().io.violationConfig.commandBlockMinecartUse.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punish = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punish;
+ main.dir().io.violationConfig.commandBlockMinecartUse.punish = !main.dir().io.violationConfig.commandBlockMinecartUse.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.commandBlockMinecartUse.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punishmentCommands);
+ },"" + main.dir().io.violationConfig.commandBlockMinecartUse.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockMinecartUse.punishmentCommands.clear();
+ main.dir().io.violationConfig.commandBlockMinecartUse.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/players/ChatEvent.java b/src/main/java/me/trouper/sentinel/server/events/violations/players/ChatEvent.java
index d93eb94..9dd8277 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/players/ChatEvent.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/players/ChatEvent.java
@@ -4,6 +4,7 @@ import io.github.itzispyder.pdk.events.CustomListener;
import io.github.itzispyder.pdk.utils.SchedulerUtils;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.events.QuickListener;
import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockBreak;
import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockEdit;
import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockPlace;
@@ -31,6 +32,7 @@ import me.trouper.sentinel.server.gui.config.chat.ProfanityFilterGUI;
import me.trouper.sentinel.server.gui.config.chat.SpamFilterGUI;
import me.trouper.sentinel.server.gui.config.chat.UnicodeFilterGUI;
import me.trouper.sentinel.server.gui.config.chat.UrlFilterGUI;
+import me.trouper.sentinel.server.gui.nbt.NBTGui;
import me.trouper.sentinel.server.gui.whitelist.WhitelistGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
@@ -39,11 +41,12 @@ import org.bukkit.event.EventHandler;
import java.util.function.Consumer;
-public class ChatEvent implements CustomListener {
+public class ChatEvent implements QuickListener {
@EventHandler
private void onChat(AsyncChatEvent e) {
- ServerUtils.verbose("Chat event sanity check:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event sanity check:\n Canceled %s", e.isCancelled()
+);
handleEvent(e);
}
@@ -61,6 +64,7 @@ public class ChatEvent implements CustomListener {
ProfanityFilterGUI.updater.invokeCallbacks(e);
SpamFilterGUI.updater.invokeCallbacks(e);
WhitelistGUI.updater.invokeCallbacks(e);
+ NBTGui.updater.invokeCallbacks(e);
DangerousCommand.updater.invokeCallbacks(e);
LoggedCommand.updater.invokeCallbacks(e);
SpecificCommand.updater.invokeCallbacks(e);
@@ -87,41 +91,46 @@ public class ChatEvent implements CustomListener {
Player p = e.getPlayer();
- ServerUtils.verbose("Chat event start after trust check:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event start after trust check:\n Canceled %s", e.isCancelled()
+);
handle(p,
"sentinel.chatfilter.unicode.bypass",
- Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.enabled, "unicode",
+ main.dir().io.mainConfig.chat.unicodeFilter.enabled, "unicode",
e,
UnicodeFilter::handleUnicodeFilter);
- ServerUtils.verbose("Chat event middle after unicode:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event middle after unicode:\n Canceled %s", e.isCancelled()
+);
handle(p,
"sentinel.chatfilter.url.bypass",
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.enabled, "url",
+ main.dir().io.mainConfig.chat.urlFilter.enabled, "url",
e,
UrlFilter::handleUrlFilter);
- ServerUtils.verbose("Chat event middle after URL:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event middle after URL:\n Canceled %s", e.isCancelled()
+);
handle(p,
"sentinel.chatfilter.spam.bypass",
- Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.enabled,
+ main.dir().io.mainConfig.chat.spamFilter.enabled,
"spam",
e,
SpamFilter::handleSpamFilter);
- ServerUtils.verbose("Chat event middle after spam:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event middle after spam:\n Canceled %s", e.isCancelled()
+);
handle(p,
- "sentinel.chatfilter.swear.bypass",
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.enabled,
+ "sentinel.chatfilter.profanity.bypass",
+ main.dir().io.mainConfig.chat.profanityFilter.enabled,
"swear",
e,
ProfanityFilter::handleProfanityFilter);
- ServerUtils.verbose("Chat event ending after swear:\n Canceled %s".formatted(e.isCancelled()));
+ ServerUtils.verbose("Chat event ending after swear:\n Canceled %s", e.isCancelled()
+);
}
private static void handle(Player p, String permission, boolean isEnabled, String eventType, AsyncChatEvent e, Consumer handler) {
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/players/CreativeHotbar.java b/src/main/java/me/trouper/sentinel/server/events/violations/players/CreativeHotbar.java
index 9c9e802..a343782 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/players/CreativeHotbar.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/players/CreativeHotbar.java
@@ -1,5 +1,6 @@
package me.trouper.sentinel.server.events.violations.players;
+import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.Pair;
import me.trouper.sentinel.Sentinel;
@@ -12,6 +13,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -29,7 +31,7 @@ public class CreativeHotbar extends AbstractViolation {
@EventHandler
private void onNBTPull(InventoryCreativeEvent e) {
//ServerUtils.verbose("NBT: Detected creative mode action");
- if (!Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.enabled) return;
+ if (!main.dir().io.violationConfig.creativeHotbarAction.enabled) return;
//ServerUtils.verbose("NBT: Enabled");
if (!(e.getWhoClicked() instanceof Player p)) return;
//ServerUtils.verbose("NBT: Clicker is a player");
@@ -38,14 +40,18 @@ public class CreativeHotbar extends AbstractViolation {
ItemStack i = e.getCursor();
if (PlayerUtils.isTrusted(p)) return;
//ServerUtils.verbose("NBT: Not trusted");
+ scan(e,p,i);
+ }
+
+ public void scan(InventoryCreativeEvent e, Player p, ItemStack i) {
if (e.getCursor().getItemMeta() == null) return;
//ServerUtils.verbose("NBT: Cursor has meta");
if (!(i.hasItemMeta() && i.getItemMeta() != null)) return;
if (!new RateLimitCheck().passes(new Pair<>(p,i))) {
List punishmentCommands = new ArrayList<>();
- for (String punishmentCommand : Sentinel.getInstance().getDirector().io.nbtConfig.rateLimit.punishmentCommands) {
+ for (String punishmentCommand : main.dir().io.nbtConfig.rateLimit.punishmentCommands) {
try {
- punishmentCommand = punishmentCommand.formatted(RateLimitCheck.dataUsed.get(p.getUniqueId()),Sentinel.getInstance().getDirector().io.nbtConfig.rateLimit.rateLimitBytes);
+ punishmentCommand = punishmentCommand.formatted(RateLimitCheck.dataUsed.get(p.getUniqueId()),main.dir().io.nbtConfig.rateLimit.rateLimitBytes);
} catch (Exception ignored) {}
punishmentCommands.add(punishmentCommand);
}
@@ -56,35 +62,33 @@ public class CreativeHotbar extends AbstractViolation {
.setPlayer(p)
.cancel(true)
.punish(true)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.deop)
+ .deop(main.dir().io.violationConfig.creativeHotbarAction.deop)
.setPunishmentCommands(punishmentCommands);
-
+
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.grab, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.nbtItem),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.grab, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.nbtItem),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.grab, main.dir().io.lang.violations.protections.rootName.nbtItem),
generatePlayerInfo(p),
config
);
-
+
return;
}
if (new ItemCheck().passes(i)) return;
ServerUtils.verbose("NBT: Item doesn't pass, performing action");
- Sentinel.getInstance().getDirector().io.nbtStorage.storeItem(i, p.getUniqueId());
+ main.dir().io.nbtStorage.storeItem(i, p.getUniqueId());
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setPlayer(p)
.cancel(true)
- .punish(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punish)
- .deop(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.deop)
- .setPunishmentCommands(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punishmentCommands)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.logToDiscord);
+ .punish(main.dir().io.violationConfig.creativeHotbarAction.punish)
+ .deop(main.dir().io.violationConfig.creativeHotbarAction.deop)
+ .setPunishmentCommands(main.dir().io.violationConfig.creativeHotbarAction.punishmentCommands)
+ .logToDiscord(main.dir().io.violationConfig.creativeHotbarAction.logToDiscord);
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.grab, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.nbtItem),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormatPlayer.formatted(p.getName(), Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.grab, Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.nbtItem),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormatPlayer,p.getName(), main.dir().io.lang.violations.protections.rootName.grab, main.dir().io.lang.violations.protections.rootName.nbtItem),
generateItemInfo(i),
config
);
@@ -93,7 +97,7 @@ public class CreativeHotbar extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Creative Hotbar Check"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Creative Hotbar Check"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -110,7 +114,7 @@ public class CreativeHotbar extends AbstractViolation {
}
ItemStack ring = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.enabled) {
+ if (main.dir().io.violationConfig.creativeHotbarAction.enabled) {
ring = Items.GREEN;
}
@@ -121,11 +125,11 @@ public class CreativeHotbar extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(2,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(6,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.creativeHotbarAction.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(2,Items.booleanItem(main.dir().io.violationConfig.creativeHotbarAction.deop,Items.configItem("De-Op",Material.END_CRYSTAL,"Remove the user's operator privileges")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.violationConfig.creativeHotbarAction.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(6,Items.booleanItem(main.dir().io.violationConfig.creativeHotbarAction.punish,Items.configItem("Punish",Material.REDSTONE_TORCH,"Run the punishment commands")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.violationConfig.creativeHotbarAction.punishmentCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands that will be ran \nif this check is flagged."));
}
@Override
@@ -135,36 +139,36 @@ public class CreativeHotbar extends AbstractViolation {
switch (e.getSlot()) {
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.enabled;
+ main.dir().io.violationConfig.creativeHotbarAction.enabled = !main.dir().io.violationConfig.creativeHotbarAction.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 2 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.deop = !Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.deop;
+ main.dir().io.violationConfig.creativeHotbarAction.deop = !main.dir().io.violationConfig.creativeHotbarAction.deop;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.logToDiscord;
+ main.dir().io.violationConfig.creativeHotbarAction.logToDiscord = !main.dir().io.violationConfig.creativeHotbarAction.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 6 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punish = !Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punish;
+ main.dir().io.violationConfig.creativeHotbarAction.punish = !main.dir().io.violationConfig.creativeHotbarAction.punish;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg, args) -> {
cfg.creativeHotbarAction.punishmentCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punishmentCommands);
+ },"" + main.dir().io.violationConfig.creativeHotbarAction.punishmentCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.creativeHotbarAction.punishmentCommands.clear();
+ main.dir().io.violationConfig.creativeHotbarAction.punishmentCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/players/EthanolPacket.java b/src/main/java/me/trouper/sentinel/server/events/violations/players/EthanolPacket.java
index 9a05d1a..3c94c12 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/players/EthanolPacket.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/players/EthanolPacket.java
@@ -11,13 +11,16 @@ import org.bukkit.inventory.Inventory;
public class EthanolPacket extends AbstractViolation implements PacketListener {
-
+
@Override
public void onPacketReceive(PacketReceiveEvent event) {
if (!event.getPacketType().equals(PacketType.Play.Client.PLUGIN_MESSAGE)) return;
WrapperPlayClientPluginMessage packet = new WrapperPlayClientPluginMessage(event);
String channel = packet.getChannelName();
- if (channel.equals())
+ if (channel.equals("auth_res")) {
+ // TODO: Finish Ethanol Detection
+ System.out.println("Detected ethanol, but I haven't coded the way to stop it yet.");
+ }
}
@Override
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingEvents.java b/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingEvents.java
index e4decd4..f98b745 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingEvents.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingEvents.java
@@ -2,7 +2,9 @@ package me.trouper.sentinel.server.events.violations.players;
import io.github.itzispyder.pdk.events.CustomListener;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.events.QuickListener;
import me.trouper.sentinel.utils.PlayerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -12,17 +14,17 @@ import org.bukkit.event.player.PlayerQuitEvent;
import java.util.List;
-public class PluginCloakingEvents implements CustomListener {
+public class PluginCloakingEvents implements QuickListener {
@EventHandler
public void onQuit(PlayerQuitEvent e) {
- PluginCloakingPacket.tabReplaceQueue.remove(e.getPlayer());
+ PluginCloakingPacket.tabReplaceQueue.remove(e.getPlayer().getUniqueId());
}
@EventHandler
public void onCommand(PlayerCommandPreprocessEvent e) {
- if (!Sentinel.getInstance().getDirector().io.mainConfig.plugin.pluginHider) return;
+ if (!main.dir().io.mainConfig.plugin.pluginHider) return;
Player p = e.getPlayer();
if (PlayerUtils.isTrusted(p)) return;
@@ -32,16 +34,16 @@ public class PluginCloakingEvents implements CustomListener {
message = message.substring(1);
}
- for (String alias : Sentinel.getInstance().getDirector().io.advConfig.commandsWithPluginAccess) {
+ for (String alias : main.dir().io.advConfig.commandsWithPluginAccess) {
if (!message.equals(alias)) continue;
e.setCancelled(true);
- p.sendMessage(Text.color(Sentinel.getInstance().getDirector().io.lang.permissions.noPlugins));
+ p.sendMessage(Text.color(main.dir().io.lang.permissions.noPlugins)); // This Player.sendMessage() call is ALLOWED. We want to let the owner set the sendMessage to whatever they want.
}
}
@EventHandler
public void onTabComplete(PlayerCommandSendEvent e) {
- if (!Sentinel.getInstance().getDirector().io.mainConfig.plugin.pluginHider) return;
+ if (!main.dir().io.mainConfig.plugin.pluginHider) return;
Player p = e.getPlayer();
if (PlayerUtils.isTrusted(p)) return;
@@ -51,13 +53,13 @@ public class PluginCloakingEvents implements CustomListener {
e.getCommands().remove(command);
continue;
}
- if (Sentinel.getInstance().getDirector().io.advConfig.commandsWithPluginAccess.contains(command)) {
+ if (main.dir().io.advConfig.commandsWithPluginAccess.contains(command)) {
e.getCommands().remove(command);
continue;
}
}
//ServerUtils.verbose("Removed all the plugin specific commands form the listing. It now contains %s".formatted(e.getCommands().stream().toList().toString()));
- for (String fakePlugin : Sentinel.getInstance().getDirector().io.advConfig.fakePlugins) {
+ for (String fakePlugin : main.dir().io.advConfig.fakePlugins) {
e.getCommands().add(fakePlugin + ":" + fakePlugin);
}
//ServerUtils.verbose("Added the fake plugins, now it contains this: %s".formatted(e.getCommands().stream().toList().toString()));
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingPacket.java b/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingPacket.java
index 9821039..ed81f56 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingPacket.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/players/PluginCloakingPacket.java
@@ -9,6 +9,7 @@ import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientTa
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDeclareCommands;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerTabComplete;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
import org.bukkit.entity.Player;
@@ -19,13 +20,13 @@ import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
-public class PluginCloakingPacket implements PacketListener {
+public class PluginCloakingPacket implements Main, PacketListener {
public static final ConcurrentLinkedQueue tabReplaceQueue = new ConcurrentLinkedQueue<>();
@Override
public void onPacketReceive(PacketReceiveEvent event) {
- if (!Sentinel.getInstance().getDirector().io.mainConfig.plugin.pluginHider) return;
+ if (!main.dir().io.mainConfig.plugin.pluginHider) return;
switch (event.getPacketType()) {
case PacketType.Play.Client.TAB_COMPLETE -> {
WrapperPlayClientTabComplete wrapper = new WrapperPlayClientTabComplete(event);
@@ -37,10 +38,10 @@ public class PluginCloakingPacket implements PacketListener {
if (text.startsWith("/")) text = text.substring(1);
text = text.split(" ")[0];
- List intendedCommands = Sentinel.getInstance().getDirector().io.advConfig.intendedCommands;
- List pluginTabCompletions = Sentinel.getInstance().getDirector().io.advConfig.pluginTabCompletions;
+ List intendedCommands = main.dir().io.advConfig.intendedCommands;
+ List pluginTabCompletions = main.dir().io.advConfig.pluginTabCompletions;
- if (Sentinel.getInstance().getDirector().io.advConfig.pluginCloakingWhitelist) {
+ if (main.dir().io.advConfig.pluginCloakingWhitelist) {
boolean whitelisted = false;
for (String pattern : intendedCommands) {
if (text.matches(pattern)) {
@@ -49,14 +50,16 @@ public class PluginCloakingPacket implements PacketListener {
}
}
if (!whitelisted) {
- ServerUtils.verbose("Caught a non-whitelisted tab completion. (%s)".formatted(text));
+ ServerUtils.verbose("Caught a non-whitelisted tab completion. (%s)", text)
+;
tabReplaceQueue.add(player.getUniqueId());
}
}
for (String pattern : pluginTabCompletions) {
if (text.matches(pattern)) {
- ServerUtils.verbose("Caught a plugin listing command tab completion. (%s -> %s)".formatted(text, pattern));
+ ServerUtils.verbose("Caught a plugin listing command tab completion. (%s -> %s)", text, pattern)
+;
tabReplaceQueue.add(player.getUniqueId());
break;
}
@@ -71,7 +74,7 @@ public class PluginCloakingPacket implements PacketListener {
@Override
public void onPacketSend(PacketSendEvent event) {
- if (!Sentinel.getInstance().getDirector().io.mainConfig.plugin.pluginHider) return;
+ if (!main.dir().io.mainConfig.plugin.pluginHider) return;
Player player = (Player) event.getPlayer();
if (player == null) return;
@@ -84,7 +87,7 @@ public class PluginCloakingPacket implements PacketListener {
ServerUtils.verbose("Player was queued for replacement, setting tab completions.");
WrapperPlayServerTabComplete wrapper = new WrapperPlayServerTabComplete(event);
List matches = new ArrayList<>();
- for (String fakePlugin : Sentinel.getInstance().getDirector().io.advConfig.fakePlugins) {
+ for (String fakePlugin : main.dir().io.advConfig.fakePlugins) {
matches.add(new WrapperPlayServerTabComplete.CommandMatch(fakePlugin));
}
wrapper.setCommandMatches(matches);
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandBlockExecute.java b/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandBlockExecute.java
index 5e54299..533314c 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandBlockExecute.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandBlockExecute.java
@@ -1,8 +1,7 @@
package me.trouper.sentinel.server.events.violations.whitelist;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.server.gui.Items;
@@ -10,6 +9,7 @@ import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.AntiNukeGUI;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -29,35 +29,36 @@ public class CommandBlockExecute extends AbstractViolation {
@EventHandler
private void commandBlockExecute(ServerCommandEvent e) {
//ServerUtils.verbose("Handling command block event: " + e.getCommand());
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockWhitelist.enabled) return;
//ServerUtils.verbose("Whitelist not disabled");
if (!(e.getSender() instanceof BlockCommandSender s)) return;
//ServerUtils.verbose("Sender is command block");
Block block = s.getBlock();
CommandBlock cb = (CommandBlock) block.getState();
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(cb.getLocation());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(cb.getLocation());
String label = cb.getCommand();
- ServerUtils.verbose("Command block is set to %s.".formatted(label));
+ ServerUtils.verbose("Command block is set to %s.", label)
+;
label = label.split(" ")[0];
if (label.startsWith("/")) label = label.substring(1);
- ServerUtils.verbose("It's label is %s.".formatted(label));
+ ServerUtils.verbose("It's label is %s.", label)
+;
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setBlock(block)
.cancel(true)
- .destroyBlock(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyBlock)
- .restoreBlock(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.attemptRestore)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.logToDiscord);
+ .destroyBlock(main.dir().io.violationConfig.commandBlockWhitelist.destroyBlock)
+ .restoreBlock(main.dir().io.violationConfig.commandBlockWhitelist.attemptRestore)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockWhitelist.logToDiscord);
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.disabledCommands.contains(label)) {
+ if (main.dir().io.violationConfig.commandBlockWhitelist.disabledCommands.contains(label)) {
ServerUtils.verbose("Command block is using a restricted command.");
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockRestriction),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted( Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockRestriction),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormat,main.dir().io.lang.violations.protections.rootName.commandBlockRestriction),
generateCommandBlockInfo(cb),
config
);
@@ -65,8 +66,7 @@ public class CommandBlockExecute extends AbstractViolation {
ServerUtils.verbose("Command block can't run. Not whitelisted and/or trusted.");
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockWhitelist),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockWhitelist),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormat,main.dir().io.lang.violations.protections.rootName.commandBlockWhitelist),
generateCommandBlockInfo(cb),
config
);
@@ -77,7 +77,7 @@ public class CommandBlockExecute extends AbstractViolation {
@Override
public CustomGui getConfigGui() {
return CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Command Block Whitelist"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Command Block Whitelist"))
.size(27)
.onDefine(this::getMainPage)
.defineMain(this::onClick)
@@ -94,7 +94,7 @@ public class CommandBlockExecute extends AbstractViolation {
}
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled) {
+ if (main.dir().io.violationConfig.commandBlockWhitelist.enabled) {
top = Items.GREEN;
}
@@ -103,12 +103,12 @@ public class CommandBlockExecute extends AbstractViolation {
}
inv.setItem(26,Items.BACK);
- inv.setItem(4,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
- inv.setItem(11,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyBlock,Items.configItem("Destroy",Material.NETHERITE_PICKAXE,"Destroy the offending command-block")));
- inv.setItem(12,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyCart,Items.configItem("Destroy",Material.TNT_MINECART,"Destroy the offending command-cart")));
- inv.setItem(13,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.attemptRestore,Items.configItem("Restore",Material.COMMAND_BLOCK,"Attempt to restore the block if a \nwhitelisted one exists at the location")));
- inv.setItem(14,Items.booleanItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
- inv.setItem(15,Items.stringListItem(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.disabledCommands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands no command blocks can run. \nWorks even if whitelist is disabled. \nYou must add plugin specific versions yourself."));
+ inv.setItem(4,Items.booleanItem(main.dir().io.violationConfig.commandBlockWhitelist.enabled,Items.configItem("Check Toggle", Material.CLOCK,"Enable/Disable this check entirely")));
+ inv.setItem(11,Items.booleanItem(main.dir().io.violationConfig.commandBlockWhitelist.destroyBlock,Items.configItem("Destroy",Material.NETHERITE_PICKAXE,"Destroy the offending command-block")));
+ inv.setItem(12,Items.booleanItem(main.dir().io.violationConfig.commandBlockWhitelist.destroyCart,Items.configItem("Destroy",Material.TNT_MINECART,"Destroy the offending command-cart")));
+ inv.setItem(13,Items.booleanItem(main.dir().io.violationConfig.commandBlockWhitelist.attemptRestore,Items.configItem("Restore",Material.COMMAND_BLOCK,"Attempt to restore the block if a \nwhitelisted one exists at the location")));
+ inv.setItem(14,Items.booleanItem(main.dir().io.violationConfig.commandBlockWhitelist.logToDiscord,Items.configItem("Log",Material.OAK_LOG,"If this check will produce a log to discord")));
+ inv.setItem(15,Items.stringListItem(main.dir().io.violationConfig.commandBlockWhitelist.disabledCommands,Material.CRIMSON_HANGING_SIGN,"Commands","Commands no command blocks can run. \nWorks even if whitelist is disabled. \nYou must add plugin specific versions yourself."));
}
@Override
@@ -117,40 +117,40 @@ public class CommandBlockExecute extends AbstractViolation {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 4 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled;
+ main.dir().io.violationConfig.commandBlockWhitelist.enabled = !main.dir().io.violationConfig.commandBlockWhitelist.enabled;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 11 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyBlock = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyBlock;
+ main.dir().io.violationConfig.commandBlockWhitelist.destroyBlock = !main.dir().io.violationConfig.commandBlockWhitelist.destroyBlock;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 12 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyCart = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyCart;
+ main.dir().io.violationConfig.commandBlockWhitelist.destroyCart = !main.dir().io.violationConfig.commandBlockWhitelist.destroyCart;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 13 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.attemptRestore = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.attemptRestore;
+ main.dir().io.violationConfig.commandBlockWhitelist.attemptRestore = !main.dir().io.violationConfig.commandBlockWhitelist.attemptRestore;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 14 -> {
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.logToDiscord = !Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.logToDiscord;
+ main.dir().io.violationConfig.commandBlockWhitelist.logToDiscord = !main.dir().io.violationConfig.commandBlockWhitelist.logToDiscord;
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
case 15 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.commandBlockWhitelist.disabledCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.disabledCommands);
+ },"" + main.dir().io.violationConfig.commandBlockWhitelist.disabledCommands);
return;
}
- Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.disabledCommands.clear();
+ main.dir().io.violationConfig.commandBlockWhitelist.disabledCommands.clear();
getMainPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.violationConfig.save();
+ main.dir().io.violationConfig.save();
}
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandMinecartExecute.java b/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandMinecartExecute.java
index c5a3752..4438a35 100644
--- a/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandMinecartExecute.java
+++ b/src/main/java/me/trouper/sentinel/server/events/violations/whitelist/CommandMinecartExecute.java
@@ -1,12 +1,12 @@
package me.trouper.sentinel.server.events.violations.whitelist;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.events.violations.AbstractViolation;
import me.trouper.sentinel.server.functions.helpers.ActionConfiguration;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.Text;
import org.bukkit.entity.minecart.CommandMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.inventory.InventoryClickEvent;
@@ -20,30 +20,31 @@ public class CommandMinecartExecute extends AbstractViolation {
@EventHandler
public void onExecute(ServerCommandEvent e) {
//ServerUtils.verbose("Handling command block event: " + e.getCommand());
- if (!Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.enabled) return;
+ if (!main.dir().io.violationConfig.commandBlockWhitelist.enabled) return;
//ServerUtils.verbose("Whitelist not disabled");
if (!(e.getSender() instanceof CommandMinecart s)) return;
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(s.getUniqueId());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(s.getUniqueId());
String label = s.getCommand();
- ServerUtils.verbose("Command block is set to %s.".formatted(label));
+ ServerUtils.verbose("Command block is set to %s.", label)
+;
label = label.split(" ")[0];
if (label.startsWith("/")) label = label.substring(1);
- ServerUtils.verbose("It's label is %s.".formatted(label));
+ ServerUtils.verbose("It's label is %s.", label)
+;
ActionConfiguration.Builder config = new ActionConfiguration.Builder()
.setEvent(e)
.setEntity(s)
.cancel(true)
- .removeEntity(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.destroyCart)
- .logToDiscord(Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.logToDiscord);
+ .removeEntity(main.dir().io.violationConfig.commandBlockWhitelist.destroyCart)
+ .logToDiscord(main.dir().io.violationConfig.commandBlockWhitelist.logToDiscord);
- if (Sentinel.getInstance().getDirector().io.violationConfig.commandBlockWhitelist.disabledCommands.contains(label)) {
+ if (main.dir().io.violationConfig.commandBlockWhitelist.disabledCommands.contains(label)) {
ServerUtils.verbose("Command cart is using a restricted command.");
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockRestriction),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted( Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockRestriction),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormat,main.dir().io.lang.violations.protections.rootName.commandBlockRestriction),
generateMinecartInfo(s),
config
);
@@ -51,8 +52,7 @@ public class CommandMinecartExecute extends AbstractViolation {
ServerUtils.verbose("Command cart can't run. Block is not whitelisted, and/or not trusted.");
runActions(
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockWhitelist),
- Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.rootNameFormat.formatted(Sentinel.getInstance().getDirector().io.lang.violations.protections.rootName.commandBlockWhitelist),
+ Text.format(Text.Pallet.WARNING,main.dir().io.lang.violations.protections.rootName.rootNameFormat,main.dir().io.lang.violations.protections.rootName.commandBlockWhitelist),
generateMinecartInfo(s),
config
);
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/AbstractActionHandler.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/AbstractActionHandler.java
index 1e9ff7f..2745f72 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/AbstractActionHandler.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/AbstractActionHandler.java
@@ -3,14 +3,15 @@ package me.trouper.sentinel.server.functions.chatfilter;
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.utils.trees.ConsoleFormatter;
import me.trouper.sentinel.utils.trees.EmbedFormatter;
import me.trouper.sentinel.utils.trees.Node;
-public abstract class AbstractActionHandler {
+public abstract class AbstractActionHandler implements Main {
public void run(T response) {
- Sentinel.getInstance().getDirector().reportHandler.reports.put(response.getReport().getId(), response.getReport());
+ main.dir().reportHandler.reports.put(response.getReport().getId(), response.getReport());
Node tree = buildTree(response);
if (response.isBlocked()) {
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/FilterResponse.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/FilterResponse.java
index ef075f8..aec097a 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/FilterResponse.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/FilterResponse.java
@@ -1,10 +1,11 @@
package me.trouper.sentinel.server.functions.chatfilter;
import io.papermc.paper.event.player.AsyncChatEvent;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.functions.helpers.Report;
import org.bukkit.entity.Player;
-public interface FilterResponse {
+public interface FilterResponse extends Main {
AsyncChatEvent getEvent();
Player getPlayer();
Report getReport();
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.java
index 7b74979..031b775 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityAction.java
@@ -1,6 +1,5 @@
package me.trouper.sentinel.server.functions.chatfilter.profanity;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.chatfilter.AbstractActionHandler;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
@@ -15,59 +14,66 @@ public class ProfanityAction extends AbstractActionHandler {
@Override
public void punish(ProfanityResponse response) {
if (response.getSeverity().equals(Severity.SLUR)) {
- for (String slurCommand : Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.strictPunishCommands) {
+ for (String slurCommand : main.dir().io.mainConfig.chat.profanityFilter.strictPunishCommands) {
ServerUtils.sendCommand(slurCommand.replaceAll("%player%", response.getPlayer().getName()));
}
}
- for (String swearCommand : Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.profanityPunishCommands) {
+ for (String swearCommand : main.dir().io.mainConfig.chat.profanityFilter.profanityPunishCommands) {
ServerUtils.sendCommand(swearCommand.replaceAll("%player%", response.getPlayer().getName()));
}
}
@Override
public void staffWarning(ProfanityResponse response, Node tree) {
- String messageText = Text.prefix("&b&n%s&r &7%s &8(&4%s&7/&c%s&8)".formatted(
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,response.isPunished() ?
+ main.dir().io.lang.violations.chat.profanity.autoPunishNotification :
+ main.dir().io.lang.violations.chat.profanity.preventNotification,
response.getPlayer().getName(),
- response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.autoPunishNotification : Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.preventNotification,
ProfanityFilter.scoreMap.getOrDefault(response.getPlayer().getUniqueId(), 0),
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.punishScore
- ));
- String hoverText = HoverFormatter.format(tree);
+ main.dir().io.mainConfig.chat.profanityFilter.punishScore
+ );
PlayerUtils.forEachPlayer(player -> {
- if (player.hasPermission("sentinel.chatfilter.profanity.view")) player.sendMessage(Component.text(messageText).hoverEvent(Component.text(hoverText).asHoverEvent()));
+ if (!player.hasPermission("sentinel.chatfilter.profanity.view")) return;
+ Text.message(Text.Pallet.INFO,player,message.hoverEvent(HoverFormatter.format(tree).asHoverEvent()));
});
}
@Override
public void playerWarning(ProfanityResponse response) {
- String message = Text.prefix(response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.autoPunishWarning : Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.preventWarning);
- String hoverText = Sentinel.getInstance().getDirector().io.lang.automatedActions.reportable;
- String command = "/sentinelcallback fpreport %s".formatted(response.getReport().getId());
- response.getPlayer().sendMessage(Component.text(message)
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ? main.dir().io.lang.violations.chat.profanity.autoPunishWarning :
+ main.dir().io.lang.violations.chat.profanity.preventWarning
+ );
+ String hoverText = main.dir().io.lang.automatedActions.reportable;
+ String command = "/sentinelcallback fpreport " + response.getReport().getId();
+ Text.message(Text.Pallet.INFO,response.getPlayer(),message
.hoverEvent(Component.text(hoverText).asHoverEvent())
- .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND,command)));
+ .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND,command))
+ );
}
@Override
public Node buildTree(ProfanityResponse response) {
- Node root = new Node("Sentinel");
- root.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.treeTitle);
+ Node root = new Node();
+ root.addTextLine(Text.format(Text.Pallet.NEUTRAL,main.dir().io.lang.violations.chat.profanity.treeTitle,response.getPlayer().name()));
- Node playerInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.score, "%s/%s".formatted(ProfanityFilter.scoreMap.getOrDefault(response.getPlayer().getUniqueId(),0),Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.punishScore));
+ Node playerInfo = new Node(main.dir().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
+ playerInfo.addKeyValue(main.dir().io.lang.violations.chat.profanity.score, "%s/%s".formatted(ProfanityFilter.scoreMap.getOrDefault(response.getPlayer().getUniqueId(),0),main.dir().io.mainConfig.chat.profanityFilter.punishScore));
root.addChild(playerInfo);
- Node reportInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.reportInfoTitle);
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.processedMessage, response.getProcessedMessage());
- reportInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.chat.profanity.severity, response.getSeverity().toString());
+ Node reportInfo = new Node(main.dir().io.lang.violations.chat.profanity.reportInfoTitle);
+ reportInfo.addField(main.dir().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
+ reportInfo.addField(Component.text(main.dir().io.lang.violations.chat.profanity.processedMessage), Node.parseLegacyText(response.getProcessedMessage()));
+ reportInfo.addKeyValue(main.dir().io.lang.violations.chat.profanity.severity, response.getSeverity().toString());
root.addChild(reportInfo);
- Node actions = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.actionNodeTitle);
- actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.denyMessage);
- if (response.isPunished()) actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
+ Node actions = new Node(main.dir().io.lang.violations.protections.actionNode.actionNodeTitle);
+ actions.addTextLine(main.dir().io.lang.violations.chat.denyMessage);
+ if (response.isPunished()) actions.addTextLine(main.dir().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
root.addChild(actions);
return root;
@@ -75,6 +81,6 @@ public class ProfanityAction extends AbstractActionHandler {
@Override
protected boolean shouldWarnPlayer(ProfanityResponse response) {
- return !Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.silent;
+ return !main.dir().io.mainConfig.chat.profanityFilter.silent;
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityFilter.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityFilter.java
index beb1ef1..b08104c 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityFilter.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityFilter.java
@@ -2,6 +2,7 @@ package me.trouper.sentinel.server.functions.chatfilter.profanity;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.utils.ServerUtils;
import org.bukkit.entity.Player;
@@ -9,7 +10,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-public class ProfanityFilter {
+public class ProfanityFilter implements Main {
public static Map scoreMap = new HashMap<>();
public static void handleProfanityFilter(AsyncChatEvent event) {
@@ -17,7 +18,7 @@ public class ProfanityFilter {
ServerUtils.verbose("Anti Profanity Opening: Event is canceled.");
}
Player player = event.getPlayer();
- ProfanityResponse response = new ProfanityResponse(null,null,null,null,null,false,false).generate(event);
+ ProfanityResponse response = ProfanityResponse.generate(event);
Severity severity = response.getSeverity();
ServerUtils.verbose("Response came back.");
if (severity == null) return;
@@ -32,7 +33,7 @@ public class ProfanityFilter {
int newScore = previousScore + severity.getScore();
scoreMap.put(player.getUniqueId(), newScore);
- if (newScore > Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.punishScore || Severity.SLUR.equals(severity)) {
+ if (newScore > main.dir().io.mainConfig.chat.profanityFilter.punishScore || Severity.SLUR.equals(severity)) {
response.setPunished(true);
new ProfanityAction().run(response);
return;
@@ -45,7 +46,7 @@ public class ProfanityFilter {
for (UUID uuid : scoreMap.keySet()) {
int score = scoreMap.get(uuid);
if (score > 0) {
- score = score - Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.scoreDecay;
+ score = score - main.dir().io.mainConfig.chat.profanityFilter.scoreDecay;
scoreMap.put(uuid, Math.max(0, score));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.java
index b69aba7..6de24a2 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/ProfanityResponse.java
@@ -2,23 +2,25 @@ package me.trouper.sentinel.server.functions.chatfilter.profanity;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.Emojis;
+import me.trouper.sentinel.data.types.Emojis;
import me.trouper.sentinel.server.functions.chatfilter.FilterResponse;
import me.trouper.sentinel.server.functions.helpers.Report;
+import me.trouper.sentinel.utils.FormatUtils;
import me.trouper.sentinel.utils.ServerUtils;
import me.trouper.sentinel.utils.Text;
-import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.entity.Player;
-import java.util.regex.Matcher;
+import java.util.Map;
import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
public class ProfanityResponse implements FilterResponse {
- private AsyncChatEvent event;
+ private final AsyncChatEvent event;
private String originalMessage;
private String processedMessage;
- private Report report;
+ private final Report report;
private Severity severity;
private boolean blocked;
private boolean punished;
@@ -37,23 +39,15 @@ public class ProfanityResponse implements FilterResponse {
public Player getPlayer() {
return event.getPlayer();
}
-
+
public AsyncChatEvent getEvent() {
return event;
}
- public void setEvent(AsyncChatEvent event) {
- this.event = event;
- }
-
public String getOriginalMessage() {
return originalMessage;
}
- public void setOriginalMessage(String originalMessage) {
- this.originalMessage = originalMessage;
- }
-
public String getProcessedMessage() {
return processedMessage;
}
@@ -66,10 +60,6 @@ public class ProfanityResponse implements FilterResponse {
return report;
}
- public void setReport(Report report) {
- this.report = report;
- }
-
public Severity getSeverity() {
return severity;
}
@@ -93,189 +83,157 @@ public class ProfanityResponse implements FilterResponse {
public void setPunished(boolean punished) {
this.punished = punished;
}
-
+
public static ProfanityResponse generate(AsyncChatEvent e) {
if (e.isCancelled()) {
- ServerUtils.verbose("Profanity response opening: Event is canceled.");
+ ServerUtils.verbose("Profanity response: Event is already cancelled.");
}
- String message = LegacyComponentSerializer.legacySection().serialize(e.message());
- Report report = Sentinel.getInstance().getDirector().reportHandler.initializeReport(message);
- Severity severity = Severity.SAFE;
+ String message = PlainTextComponentSerializer.plainText().serialize(e.message());
+ Report report = main.dir().reportHandler.initializeReport(message);
+ ProfanityResponse response = new ProfanityResponse(e, message, message, report, Severity.SAFE, false, false);
+ Severity currentSeverity;
- ProfanityResponse response = new ProfanityResponse(e,message,null,report,severity,false,false);
+ // Stage 1: Basic check on lowercased text
+ String processedText = Text.removeColors(message).toLowerCase();
+ report.getStepsTaken().put("Lowercased", processedText);
+ ServerUtils.verbose("ProfanityFilter: Lowercased: " + processedText);
+ currentSeverity = checkProfanity(processedText, Severity.LOW);
+ if (currentSeverity != Severity.SAFE) return finalizeResponse(response, processedText, "Lowercased", currentSeverity);
- String text = Text.removeFirstColor(message);
- response.setOriginalMessage(text);
-
- // 1:
- String lowercasedText = text.toLowerCase();
- response.getReport().getStepsTaken().put("Lowercased", lowercasedText);
- response.setProcessedMessage(highlightProfanity(lowercasedText,"", ""));
- ServerUtils.verbose("ProfanityFilter: Lowercased: " + lowercasedText);
+ // Stage 2: Mask allowed words
+ processedText = maskValidWords(processedText);
+ report.getStepsTaken().put("Masked Valid Words", processedText);
+ ServerUtils.verbose("ProfanityFilter: Masked Valid Words: " + processedText);
- // 2:
- String cleanedText = removeFalsePositives(lowercasedText);
- response.getReport().getStepsTaken().put("Remove False Positives", cleanedText);
- response.setProcessedMessage(highlightProfanity(cleanedText,"", ""));
- ServerUtils.verbose(("ProfanityFilter: Removed False positives: " + cleanedText));
+ // Stage 3: Convert LeetSpeak (e.g., @ -> a, 3 -> e)
+ processedText = convertLeetSpeakCharacters(processedText);
+ report.getStepsTaken().put("Convert LeetSpeak", processedText);
+ ServerUtils.verbose("ProfanityFilter: Leet Converted: " + processedText);
+ currentSeverity = checkProfanity(processedText, Severity.MEDIUM_LOW);
+ if (currentSeverity != Severity.SAFE) return finalizeResponse(response, processedText, "Convert LeetSpeak", currentSeverity);
- response.setSeverity(checkProfanity(cleanedText, Severity.LOW));
- if (response.getSeverity() != Severity.SAFE) {
- response.getReport().getStepsTaken().replace("Remove False Positives", "%s %s".formatted(
- highlightProfanity(cleanedText,"||","||"),
- Emojis.alarm));
- return response;
- }
+ // Stage 4: Strip special characters
+ processedText = stripSpecialCharacters(processedText);
+ report.getStepsTaken().put("Remove Special Characters", processedText);
+ ServerUtils.verbose("ProfanityFilter: Specials Removed: " + processedText);
+ currentSeverity = checkProfanity(processedText, Severity.MEDIUM);
+ if (currentSeverity != Severity.SAFE) return finalizeResponse(response, processedText, "Remove Special Characters", currentSeverity);
- // 4:
- String convertedText = convertLeetSpeakCharacters(cleanedText);
- response.getReport().getStepsTaken().put("Convert LeetSpeak", convertedText);
- response.setProcessedMessage(highlightProfanity(convertedText,"", ""));
- ServerUtils.verbose(("ProfanityFilter: Leet Converted: " + convertedText));
+ // Stage 5: Simplify repeating letters (e.g., heeeello -> helo)
+ processedText = simplifyRepeatingLetters(processedText);
+ report.getStepsTaken().put("Remove Repeats", processedText);
+ ServerUtils.verbose("ProfanityFilter: Removed Repeating: " + processedText);
+ currentSeverity = checkProfanity(processedText, Severity.MEDIUM_HIGH);
+ if (currentSeverity != Severity.SAFE) return finalizeResponse(response, processedText, "Remove Repeats", currentSeverity);
- response.setSeverity(checkProfanity(convertedText, Severity.MEDIUM_LOW));
- if (response.getSeverity() != Severity.SAFE) {
- response.getReport().getStepsTaken().replace("Convert LeetSpeak", "%s %s".formatted(
- highlightProfanity(cleanedText,"||","||"),
- Emojis.alarm));
- return response;
- }
+ // Stage 6: Remove all spaces and remaining punctuation
+ processedText = removePunctuation(processedText);
+ report.getStepsTaken().put("Remove Punctuation", processedText);
+ ServerUtils.verbose("ProfanityFilter: Remove Punctuation: " + processedText);
+ currentSeverity = checkProfanity(processedText, Severity.HIGH);
+ if (currentSeverity != Severity.SAFE) return finalizeResponse(response, processedText, "Remove Punctuation", currentSeverity);
- // 6:
- String strippedText = stripSpecialCharacters(convertedText);
- response.getReport().getStepsTaken().put("Remove Special Characters", strippedText);
- response.setProcessedMessage(highlightProfanity(strippedText,"", ""));
- ServerUtils.verbose(("ProfanityFilter: Specials Removed: " + strippedText));
-
- response.setSeverity(checkProfanity(strippedText, Severity.MEDIUM));
- if (response.getSeverity() != Severity.SAFE) {
- response.getReport().getStepsTaken().replace("Remove Special Characters", "%s %s".formatted(
- highlightProfanity(cleanedText,"||","||"),
- Emojis.alarm));
- return response;
- }
-
- // 8:
- String simplifiedText = simplifyRepeatingLetters(strippedText);
- response.getReport().getStepsTaken().put("Remove Repeats", simplifiedText);
- response.setProcessedMessage(highlightProfanity(simplifiedText,"", ""));
- ServerUtils.verbose(("ProfanityFilter: Removed Repeating: " + simplifiedText));
-
- response.setSeverity(checkProfanity(simplifiedText, Severity.MEDIUM_HIGH));
- if (response.getSeverity() != Severity.SAFE) {
- response.getReport().getStepsTaken().replace("Remove Repeats", "%s %s".formatted(
- highlightProfanity(cleanedText,"||","||"),
- Emojis.alarm));
- return response;
- }
-
- // 10:
- String finalText = removePeriodsAndSpaces(simplifiedText);
- response.getReport().getStepsTaken().put("Remove Punctuation", finalText);
- response.setProcessedMessage(highlightProfanity(finalText,"", ""));
- ServerUtils.verbose(("ProfanityFilter: Remove Punctuation: " + finalText));
-
- response.setSeverity(checkProfanity(finalText, Severity.HIGH));
- if (response.getSeverity() != Severity.SAFE) {
- response.getReport().getStepsTaken().replace("Remove Punctuation", "%s %s".formatted(
- highlightProfanity(cleanedText,"||","||"),
- Emojis.alarm));
- return response;
- }
-
- ServerUtils.verbose(("ProfanityFilter: Finished " + finalText));
- if (e.isCancelled()) {
- ServerUtils.verbose("Profanity response closing: Event is canceled.");
- }
+ ServerUtils.verbose("ProfanityFilter: Finished. No profanity detected.");
return response;
}
-
- private static Severity checkProfanity(String text, Severity backup) {
+
+ private static ProfanityResponse finalizeResponse(ProfanityResponse response, String text, String stage, Severity severity) {
+ response.setSeverity(severity);
+ String highlightedText = highlightAllProfanity(text, "||", "||");
+ response.getReport().getStepsTaken().replace(stage, "%s %s".formatted(highlightedText, Emojis.alarm));
+ response.setProcessedMessage(highlightAllProfanity(text,"█HS█","█HE█"));
+ ServerUtils.verbose("ProfanityFilter: Flagged at stage '%s' with severity '%s'", stage, severity)
+;
+ return response;
+ }
+
+ private static Severity checkProfanity(String text, Severity current) {
if (containsSlurs(text)) return Severity.SLUR;
- if (containsSwears(text)) return backup;
+ if (containsSwears(text)) return current;
return Severity.SAFE;
}
private static boolean containsSwears(String text) {
- ServerUtils.verbose("ProfanityFilter: Checking for swears");
- for (String swear : Sentinel.getInstance().getDirector().io.swearList.swears) {
+ ServerUtils.verbose("ProfanityFilter: Checking for swears in: " + text);
+ for (String swear : main.dir().io.swearList.swears) {
if (text.contains(swear)) return true;
}
-
- Pattern pattern = Pattern.compile(Sentinel.getInstance().getDirector().io.swearList.regexSwears, Pattern.CASE_INSENSITIVE);
- Matcher matcher = pattern.matcher(text);
-
- return matcher.find() && Sentinel.getInstance().getDirector().io.swearList.useRegex;
+ if (main.dir().io.swearList.useRegex) {
+ Pattern pattern = Pattern.compile(main.dir().io.swearList.regexSwears, Pattern.CASE_INSENSITIVE);
+ return pattern.matcher(text).find();
+ }
+ return false;
}
private static boolean containsSlurs(String text) {
- ServerUtils.verbose("ProfanityFilter: Checking for slurs");
- for (String slur : Sentinel.getInstance().getDirector().io.strictList.strict) {
+ ServerUtils.verbose("ProfanityFilter: Checking for slurs in: " + text);
+ for (String slur : main.dir().io.strictList.strict) {
if (text.contains(slur)) return true;
}
-
- Pattern pattern = Pattern.compile(Sentinel.getInstance().getDirector().io.strictList.regexStrict, Pattern.CASE_INSENSITIVE);
- Matcher matcher = pattern.matcher(text);
-
- return matcher.find() && Sentinel.getInstance().getDirector().io.strictList.useRegex;
- }
-
- private static String removeFalsePositives(String text) {
- for (String falsePositive : Sentinel.getInstance().getDirector().io.falsePositiveList.swearWhitelist) {
- text = text.replace(falsePositive, "");
+ if (main.dir().io.strictList.useRegex) {
+ Pattern pattern = Pattern.compile(main.dir().io.strictList.regexStrict, Pattern.CASE_INSENSITIVE);
+ return pattern.matcher(text).find();
}
- if (Sentinel.getInstance().getDirector().io.falsePositiveList.useRegex) text = text.replaceAll(Sentinel.getInstance().getDirector().io.falsePositiveList.regexWhitelist,"");
- return text;
+ return false;
+ }
+
+ private static String maskValidWords(String text) {
+ String result = text;
+ for (String falsePositive : main.dir().io.falsePositiveList.swearWhitelist) {
+ result = result.replace(falsePositive, "█SW█");
+ }
+ if (main.dir().io.falsePositiveList.useRegex) {
+ result = result.replaceAll(main.dir().io.falsePositiveList.regexWhitelist, "█RW█");
+ }
+ for (String falsePositive : main.dir().io.falsePositiveList.cleanWords) {
+ result = result.replace(falsePositive, "█CW█");
+ }
+ return result;
}
private static String convertLeetSpeakCharacters(String text) {
- text = Text.fromLeetString(text);
+ Map dictionary = Sentinel.getInstance().getDirector().io.advConfig.leetPatterns;
+
+ for (String key : dictionary.keySet()) {
+ if (!text.contains(key)) continue;
+ try {
+ if (key.equals("$")) {
+ text = text.replaceAll("\\$", "s");
+ }
+ else {
+ text = text.replaceAll(key, dictionary.get(key));
+ }
+ } catch (PatternSyntaxException ex) {
+ String regex = "[" + key + "]";
+ text = text.replaceAll(regex, dictionary.get(key));
+ }
+ }
return text;
}
private static String stripSpecialCharacters(String text) {
- text = text.replaceAll("[^A-Za-z0-9.,!?;:'\"()\\[\\]{}]", "").trim();
- return text;
+ return text.replaceAll("(?!█[A-Z]{2}█)[^a-zA-Z0-9\\s,.?!█]", "");
}
private static String simplifyRepeatingLetters(String text) {
- text = Text.replaceRepeatingLetters(text);
- return text;
+ return FormatUtils.replaceRepeatingLetters(text);
}
- private static String removePeriodsAndSpaces(String text) {
- return text.replaceAll("[^A-Za-z0-9]", "").replace(" ", "");
+ private static String removePunctuation(String text) {
+ return text.replaceAll("[.,!?\\s]", "");
}
-
- private static String highlightProfanity(String text, String start, String end) {
- String highlightedSwears = highlightSwears(fullSimplify(text), start, end);
- return Text.color(highlightSlurs(highlightedSwears, start, end));
- }
-
- private static String highlightSwears(String text, String start, String end) {
- for (String swear : Sentinel.getInstance().getDirector().io.swearList.swears) {
- text = text.replace(swear, start + swear + end);
- }
- return text;
- }
-
- private static String highlightSlurs(String text, String start, String end) {
- for (String slur : Sentinel.getInstance().getDirector().io.strictList.strict) {
- text = text.replace(slur, start + slur + end);
- }
- return text;
- }
-
- private static String fullSimplify(String text) {
- String lowercasedText = text.toLowerCase();
- String cleanedText = removeFalsePositives(lowercasedText);
- String convertedText =convertLeetSpeakCharacters(cleanedText);
- String strippedText = stripSpecialCharacters(convertedText);
- String simplifiedText = simplifyRepeatingLetters(strippedText);
- return removePeriodsAndSpaces(simplifiedText);
- }
-
+ private static String highlightAllProfanity(String text, String start, String end) {
+ String result = text;
+ for (String slur : main.dir().io.strictList.strict) {
+ result = result.replace(slur, start + slur + end);
+ }
+
+ for (String swear : main.dir().io.swearList.swears) {
+ result = result.replace(swear, start + swear + end);
+ }
+ return Text.legacyColor(result);
+ }
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.java
index 8cf7dc2..64d1e6e 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/profanity/Severity.java
@@ -1,15 +1,16 @@
package me.trouper.sentinel.server.functions.chatfilter.profanity;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
-public enum Severity {
- LOW(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.lowScore),
- MEDIUM_LOW(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumLowScore),
- MEDIUM(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumScore),
- MEDIUM_HIGH(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumHighScore),
- HIGH(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.highScore),
- REGEX(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.regexScore),
- SLUR(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.highScore),
+public enum Severity implements Main {
+ LOW(main.dir().io.mainConfig.chat.profanityFilter.lowScore),
+ MEDIUM_LOW(main.dir().io.mainConfig.chat.profanityFilter.mediumLowScore),
+ MEDIUM(main.dir().io.mainConfig.chat.profanityFilter.mediumScore),
+ MEDIUM_HIGH(main.dir().io.mainConfig.chat.profanityFilter.mediumHighScore),
+ HIGH(main.dir().io.mainConfig.chat.profanityFilter.highScore),
+ REGEX(main.dir().io.mainConfig.chat.profanityFilter.regexScore),
+ SLUR(main.dir().io.mainConfig.chat.profanityFilter.highScore),
SAFE(0);
private final int score;
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.java
index 0548fc2..9437cb7 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamAction.java
@@ -1,6 +1,5 @@
package me.trouper.sentinel.server.functions.chatfilter.spam;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.chatfilter.AbstractActionHandler;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
@@ -14,55 +13,63 @@ public class SpamAction extends AbstractActionHandler {
@Override
public void punish(SpamResponse response) {
- for (String spamPunishCommand : Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishCommands) {
+ for (String spamPunishCommand : main.dir().io.mainConfig.chat.spamFilter.punishCommands) {
ServerUtils.sendCommand(spamPunishCommand.replaceAll("%player%", response.getEvent().getPlayer().getName()));
}
}
@Override
- public void staffWarning(SpamResponse report, Node tree) {
- String messageText = Text.prefix("&b&n%s&r &7%s &8(&4%s&7/&c%s&8)".formatted(
- report.getEvent().getPlayer().getName(),
- report.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.autoPunishNotification : Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.preventNotification,
- SpamFilter.heatMap.get(report.getEvent().getPlayer().getUniqueId()),
- Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishHeat
- ));
- String hoverText = HoverFormatter.format(tree);
+ public void staffWarning(SpamResponse response, Node tree) {
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ?
+ main.dir().io.lang.violations.chat.spam.autoPunishNotification :
+ main.dir().io.lang.violations.chat.spam.preventNotification,
+ response.getEvent().getPlayer().getName(),
+ SpamFilter.heatMap.get(response.getEvent().getPlayer().getUniqueId()),
+ main.dir().io.mainConfig.chat.spamFilter.punishHeat
+ );
PlayerUtils.forEachPlayer(player -> {
- if (player.hasPermission("sentinel.chatfilter.spam.view")) player.sendMessage(Component.text(messageText).hoverEvent(Component.text(hoverText).asHoverEvent()));
+ if (!player.hasPermission("sentinel.chatfilter.spam.view")) return;
+ Text.message(Text.Pallet.INFO, player, message.hoverEvent(HoverFormatter.format(tree).asHoverEvent()));
});
}
@Override
public void playerWarning(SpamResponse response) {
- String message = Text.prefix(response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.autoPunishWarning : Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.preventWarning) ;
- String hoverText = Sentinel.getInstance().getDirector().io.lang.automatedActions.reportable;
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ? main.dir().io.lang.violations.chat.spam.autoPunishWarning :
+ main.dir().io.lang.violations.chat.spam.preventWarning
+ );
+ String hoverText = main.dir().io.lang.automatedActions.reportable;
String command = "/sentinelcallback fpreport %s".formatted(response.getReport().getId());
- response.getEvent().getPlayer().sendMessage(Component.text(message)
- .hoverEvent(Component.text(hoverText).asHoverEvent())
- .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND,command)));
+ Text.message(Text.Pallet.INFO, response.getEvent().getPlayer(), message
+ .hoverEvent(Component.text(hoverText).asHoverEvent())
+ .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, command))
+ );
}
@Override
public Node buildTree(SpamResponse response) {
Node root = new Node("Sentinel");
- root.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.treeTitle);
+ root.addTextLine(Text.format(Text.Pallet.NEUTRAL, Component.text(main.dir().io.lang.violations.chat.spam.treeTitle),response.getPlayer().name()));
- Node playerInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getEvent().getPlayer().getName()));
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.uuid, response.getEvent().getPlayer().getUniqueId().toString());
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.heat, "%s/%s".formatted(SpamFilter.heatMap.get(response.getEvent().getPlayer().getUniqueId()),Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishHeat));
+ Node playerInfo = new Node(main.dir().io.lang.violations.protections.infoNode.playerInfo);
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.uuid, response.getEvent().getPlayer().getUniqueId().toString());
+ playerInfo.addKeyValue(main.dir().io.lang.violations.chat.spam.heat, "%s/%s".formatted(SpamFilter.heatMap.get(response.getEvent().getPlayer().getUniqueId()),main.dir().io.mainConfig.chat.spamFilter.punishHeat));
root.addChild(playerInfo);
- Node reportInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.reportInfoTitle);
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.previousMessage, response.getPreviousMessage());
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.currentMessage, response.getCurrentMessage());
- reportInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.chat.spam.similarity, "%s/%s".formatted((int) Math.round(response.getSimilarity()),Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity));
+ Node reportInfo = new Node(main.dir().io.lang.violations.chat.spam.reportInfoTitle);
+ reportInfo.addField(main.dir().io.lang.violations.chat.spam.previousMessage, response.getPreviousMessage());
+ reportInfo.addField(main.dir().io.lang.violations.chat.spam.currentMessage, response.getCurrentMessage());
+ reportInfo.addKeyValue(main.dir().io.lang.violations.chat.spam.similarity, "%s/%s".formatted((int) Math.round(response.getSimilarity()),main.dir().io.mainConfig.chat.spamFilter.blockSimilarity));
root.addChild(reportInfo);
- Node actions = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.actionNodeTitle);
- actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.denyMessage);
- if (response.isPunished()) actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
+ Node actions = new Node(main.dir().io.lang.violations.protections.actionNode.actionNodeTitle);
+ actions.addTextLine(main.dir().io.lang.violations.chat.denyMessage);
+ if (response.isPunished()) actions.addTextLine(main.dir().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
root.addChild(actions);
return root;
@@ -70,6 +77,6 @@ public class SpamAction extends AbstractActionHandler {
@Override
protected boolean shouldWarnPlayer(SpamResponse response) {
- return !Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.silent;
+ return !main.dir().io.mainConfig.chat.spamFilter.silent;
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamFilter.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamFilter.java
index 82e02ed..f9f79a0 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamFilter.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamFilter.java
@@ -1,17 +1,19 @@
package me.trouper.sentinel.server.functions.chatfilter.spam;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
+import me.trouper.sentinel.utils.FormatUtils;
import me.trouper.sentinel.utils.ServerUtils;
import me.trouper.sentinel.utils.Text;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-public class SpamFilter {
+public class SpamFilter implements Main {
public static Map heatMap = new HashMap<>();
public static Map lastMessageMap = new HashMap<>();
@@ -20,8 +22,8 @@ public class SpamFilter {
ServerUtils.verbose("Anti Spam Opening: Event is canceled.");
}
Player p = e.getPlayer();
- String message = Text.removeFirstColor(LegacyComponentSerializer.legacySection().serialize(e.message()));
- for (String whitelistedMessage : Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.whitelist) {
+ String message = PlainTextComponentSerializer.plainText().serialize(e.message());
+ for (String whitelistedMessage : main.dir().io.mainConfig.chat.spamFilter.whitelist) {
if (whitelistedMessage.equalsIgnoreCase(message)) return;
}
int currentHeat = heatMap.getOrDefault(p.getUniqueId(),0);
@@ -34,7 +36,7 @@ public class SpamFilter {
ServerUtils.verbose("AntiSpam responded");
response.getReport().getStepsTaken().put("Response came back", "Heat to add: %s".formatted(addHeat));
- if (currentHeat > Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishHeat) {
+ if (currentHeat > main.dir().io.mainConfig.chat.spamFilter.punishHeat) {
response.setBlocked(true);
response.getReport().getStepsTaken().put("Punished user", "Their final heat was %s".formatted(currentHeat));
response.setPunished(true);
@@ -43,7 +45,7 @@ public class SpamFilter {
return;
}
- if (currentHeat > Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockHeat) {
+ if (currentHeat > main.dir().io.mainConfig.chat.spamFilter.blockHeat) {
response.setBlocked(true);
response.getReport().getStepsTaken().put("Blocked message", "Their heat is %s".formatted(currentHeat));
new SpamAction().run(response);
@@ -51,7 +53,7 @@ public class SpamFilter {
return;
}
- if (response.getSimilarity() > Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity) {
+ if (response.getSimilarity() > main.dir().io.mainConfig.chat.spamFilter.blockSimilarity) {
response.setBlocked(true);
response.getReport().getStepsTaken().put("Blocked message", "The similarity was too high! %s".formatted(response.getSimilarity()));
new SpamAction().run(response);
@@ -69,7 +71,7 @@ public class SpamFilter {
for (UUID p : heatMap.keySet()) {
int heat = heatMap.getOrDefault(p,0);
if (heat > 0) {
- heat = heat - Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.heatDecay;
+ heat = heat - main.dir().io.mainConfig.chat.spamFilter.heatDecay;
heatMap.put(p, Math.max(0, heat));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.java
index 0cd0e68..fe72137 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/spam/SpamResponse.java
@@ -2,9 +2,9 @@ package me.trouper.sentinel.server.functions.chatfilter.spam;
import io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.chatfilter.FilterResponse;
import me.trouper.sentinel.server.functions.helpers.Report;
+import me.trouper.sentinel.utils.FormatUtils;
import me.trouper.sentinel.utils.MathUtils;
import me.trouper.sentinel.utils.ServerUtils;
import me.trouper.sentinel.utils.Text;
@@ -39,9 +39,9 @@ public class SpamResponse implements FilterResponse {
}
String message = LegacyComponentSerializer.legacySection().serialize(e.message());
- Report report = Sentinel.getInstance().getDirector().reportHandler.initializeReport(message);
+ Report report = main.dir().reportHandler.initializeReport(message);
- message = Text.removeFirstColor(message);
+ message = Text.removeColors(message);
String previousMessage = lastMessageMap.getOrDefault(e.getPlayer().getUniqueId(),"/* Placeholder Message from Sentinel */");
SpamResponse response = new SpamResponse(e,message,previousMessage,0,0,report,false,false);
@@ -51,25 +51,25 @@ public class SpamResponse implements FilterResponse {
response.setSimilarity(similarity);
report.getStepsTaken().put("Calculated Similarity: ","%s".formatted(similarity));
- int addHeat = Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.defaultGain;
- if (similarity > Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity) {
- addHeat = Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.highGain;
- response.getReport().getStepsTaken().put("Similarity is greater than %s%%".formatted(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity), "That is %s heat. (Auto-Block due to configured value)".formatted(addHeat));
+ int addHeat = main.dir().io.mainConfig.chat.spamFilter.defaultGain;
+ if (similarity > main.dir().io.mainConfig.chat.spamFilter.blockSimilarity) {
+ addHeat = main.dir().io.mainConfig.chat.spamFilter.highGain;
+ response.getReport().getStepsTaken().put("Similarity is greater than %s%%".formatted(main.dir().io.mainConfig.chat.spamFilter.blockSimilarity), "That is %s heat. (Auto-Block due to configured value)".formatted(addHeat));
response.setHeatAdded(addHeat);
return response;
} else if (similarity > 90) {
- addHeat = Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.highGain;
+ addHeat = main.dir().io.mainConfig.chat.spamFilter.highGain;
response.getReport().getStepsTaken().put("Similarity is greater than 90%", "That is %s heat.".formatted(addHeat));
response.setHeatAdded(addHeat);
return response;
} else if (similarity > 50) {
- addHeat = Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.mediumGain;
+ addHeat = main.dir().io.mainConfig.chat.spamFilter.mediumGain;
response.getReport().getStepsTaken().put("Similarity is greater than 50%", "That is %s heat.".formatted(addHeat));
response.setHeatAdded(addHeat);
return response;
} else if (similarity > 25) {
response.getReport().getStepsTaken().put("Similarity is greater than 25%", "That is %s heat.".formatted(addHeat));
- addHeat = Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.lowGain;
+ addHeat = main.dir().io.mainConfig.chat.spamFilter.lowGain;
response.setHeatAdded(addHeat);
return response;
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeAction.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeAction.java
index 2ad38e0..dd04036 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeAction.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeAction.java
@@ -1,6 +1,5 @@
package me.trouper.sentinel.server.functions.chatfilter.unicode;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.chatfilter.AbstractActionHandler;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
@@ -13,51 +12,59 @@ import net.kyori.adventure.text.event.ClickEvent;
public class UnicodeAction extends AbstractActionHandler {
@Override
protected void punish(UnicodeResponse response) {
- for (String punishCommand : Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punishCommands) {
- ServerUtils.sendCommand(punishCommand.replaceAll("%player%",response.getPlayer().getName()));
+ for (String punishCommand : main.dir().io.mainConfig.chat.unicodeFilter.punishCommands) {
+ ServerUtils.sendCommand(punishCommand.replaceAll("%player%", response.getPlayer().getName()));
}
}
@Override
protected void staffWarning(UnicodeResponse response, Node tree) {
- String messageText = Text.prefix("&b&n%s&r &7%s".formatted(
- response.getPlayer().getName(),
- response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.autoPunishNotification : Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.preventNotification
- ));
- String hoverText = HoverFormatter.format(tree);
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ?
+ main.dir().io.lang.violations.chat.unicode.autoPunishNotification :
+ main.dir().io.lang.violations.chat.unicode.preventNotification,
+ response.getPlayer().getName()
+ );
PlayerUtils.forEachPlayer(player -> {
- if (player.hasPermission("sentinel.chatfilter.unicode.view")) player.sendMessage(Component.text(messageText).hoverEvent(Component.text(hoverText).asHoverEvent()));
+ if (!player.hasPermission("sentinel.chatfilter.unicode.view")) return;
+ Text.message(Text.Pallet.INFO, player, message.hoverEvent(HoverFormatter.format(tree).asHoverEvent()));
});
}
@Override
protected void playerWarning(UnicodeResponse response) {
- String message = Text.prefix(response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.autoPunishWarning : Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.preventWarning);
- String hoverText = Sentinel.getInstance().getDirector().io.lang.automatedActions.reportable;
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ? main.dir().io.lang.violations.chat.unicode.autoPunishWarning :
+ main.dir().io.lang.violations.chat.unicode.preventWarning
+ );
+ String hoverText = main.dir().io.lang.automatedActions.reportable;
String command = "/sentinelcallback fpreport %s".formatted(response.getReport().getId());
- response.getPlayer().sendMessage(Component.text(message)
+ Text.message(Text.Pallet.INFO, response.getPlayer(), message
.hoverEvent(Component.text(hoverText).asHoverEvent())
- .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND,command)));
+ .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, command))
+ );
}
@Override
protected Node buildTree(UnicodeResponse response) {
Node root = new Node("Sentinel");
- root.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.treeTitle);
+ root.addTextLine(Text.format(Text.Pallet.NEUTRAL,Component.text(main.dir().io.lang.violations.chat.unicode.treeTitle),response.getPlayer().name()));
- Node playerInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
+ Node playerInfo = new Node(main.dir().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
root.addChild(playerInfo);
- Node reportInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.chat.unicode.reportInfoTitle);
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.highlightedMessage, response.getHighlightedMessage());
+ Node reportInfo = new Node(main.dir().io.lang.violations.chat.unicode.reportInfoTitle);
+ reportInfo.addField(main.dir().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
+ reportInfo.addField(Component.text(main.dir().io.lang.violations.chat.highlightedMessage), Node.parseLegacyText(response.getHighlightedMessage()));
root.addChild(reportInfo);
- Node actions = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.actionNodeTitle);
- actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.denyMessage);
- if (response.isPunished()) actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
+ Node actions = new Node(main.dir().io.lang.violations.protections.actionNode.actionNodeTitle);
+ actions.addTextLine(main.dir().io.lang.violations.chat.denyMessage);
+ if (response.isPunished()) actions.addTextLine(main.dir().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
root.addChild(actions);
return root;
@@ -65,6 +72,6 @@ public class UnicodeAction extends AbstractActionHandler {
@Override
protected boolean shouldWarnPlayer(UnicodeResponse response) {
- return !Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.silent;
+ return !main.dir().io.mainConfig.chat.unicodeFilter.silent;
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeResponse.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeResponse.java
index a9e43c8..583691c 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeResponse.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/unicode/UnicodeResponse.java
@@ -2,10 +2,10 @@ package me.trouper.sentinel.server.functions.chatfilter.unicode;
import io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.Emojis;
+import me.trouper.sentinel.data.types.Emojis;
import me.trouper.sentinel.server.functions.chatfilter.FilterResponse;
import me.trouper.sentinel.server.functions.helpers.Report;
+import me.trouper.sentinel.utils.FormatUtils;
import me.trouper.sentinel.utils.ServerUtils;
import me.trouper.sentinel.utils.Text;
import org.bukkit.entity.Player;
@@ -37,29 +37,31 @@ public class UnicodeResponse implements FilterResponse {
}
String message = LegacyComponentSerializer.legacySection().serialize(e.message());
- message = Text.removeFirstColor(message);
- Report report = Sentinel.getInstance().getDirector().reportHandler.initializeReport(message);
+ message = Text.removeColors(message);
+ Report report = main.dir().reportHandler.initializeReport(message);
- UnicodeResponse response = new UnicodeResponse(e,message,message,report,false,false);
-
- String disallowedRegex = Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.regex;
- ServerUtils.verbose("Regex: %s\nMessage: %s".formatted(disallowedRegex,message));
+ UnicodeResponse response = new UnicodeResponse(e, message, message, report, false, false);
+ String disallowedRegex = main.dir().io.mainConfig.chat.unicodeFilter.regex;
Pattern pattern = Pattern.compile(disallowedRegex, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(message);
- ServerUtils.verbose("Matcher result %s\nGroup 1: %s".formatted(matcher.find(),matcher.find() ? matcher.group() : ""));
+
+ boolean found = matcher.find();
- response.getReport().getStepsTaken().put("Anti-URL", "`%s`".formatted(
- message
- ));
+ ServerUtils.verbose("Matcher result: %s",found);
+ if (found) {
+ ServerUtils.verbose("Group 1: %s",matcher.group());
+ }
- if (matcher.find()) {
- ServerUtils.verbose("Unicode Filter: Caught Unicode: " + disallowedRegex);
+ response.getReport().getStepsTaken().put("Anti-Unicode", "`" + message + "`");
+
+ if (found) {
+ ServerUtils.verbose("Unicode Filter: Caught Unicode using regex: " + disallowedRegex);
response.getReport().getStepsTaken().replace("Anti-Unicode", "`%s` %s".formatted(message, Emojis.alarm));
response.setBlocked(true);
- response.setPunished(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punished);
- response.setHighlightedMessage(Text.regexHighlighter(message,Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.regex," > ", " < "));
+ response.setPunished(main.dir().io.mainConfig.chat.unicodeFilter.punished);
+ response.setHighlightedMessage(FormatUtils.regexHighlighter(message, disallowedRegex, "█HS█", "█HE█"));
}
return response;
@@ -117,4 +119,4 @@ public class UnicodeResponse implements FilterResponse {
public void setPunished(boolean punished) {
this.punished = punished;
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlAction.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlAction.java
index 6c27539..548b52e 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlAction.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlAction.java
@@ -1,6 +1,5 @@
package me.trouper.sentinel.server.functions.chatfilter.url;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.server.functions.chatfilter.AbstractActionHandler;
import me.trouper.sentinel.utils.PlayerUtils;
import me.trouper.sentinel.utils.ServerUtils;
@@ -13,51 +12,59 @@ import net.kyori.adventure.text.event.ClickEvent;
public class UrlAction extends AbstractActionHandler {
@Override
protected void punish(UrlResponse response) {
- for (String punishCommand : Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punishCommands) {
- ServerUtils.sendCommand(punishCommand.replaceAll("%player%",response.getPlayer().getName()));
+ for (String punishCommand : main.dir().io.mainConfig.chat.urlFilter.punishCommands) {
+ ServerUtils.sendCommand(punishCommand.replaceAll("%player%", response.getPlayer().getName()));
}
}
@Override
protected void staffWarning(UrlResponse response, Node tree) {
- String messageText = Text.prefix("&b&n%s&r &7%s".formatted(
- response.getPlayer().getName(),
- response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.url.autoPunishNotification : Sentinel.getInstance().getDirector().io.lang.violations.chat.url.preventNotification
- ));
- String hoverText = HoverFormatter.format(tree);
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ?
+ main.dir().io.lang.violations.chat.url.autoPunishNotification :
+ main.dir().io.lang.violations.chat.url.preventNotification,
+ response.getPlayer().getName()
+ );
PlayerUtils.forEachPlayer(player -> {
- if (player.hasPermission("sentinel.chatfilter.url.view")) player.sendMessage(Component.text(messageText).hoverEvent(Component.text(hoverText).asHoverEvent()));
+ if (!player.hasPermission("sentinel.chatfilter.url.view")) return;
+ Text.message(Text.Pallet.INFO, player, message.hoverEvent(HoverFormatter.format(tree).asHoverEvent()));
});
}
@Override
protected void playerWarning(UrlResponse response) {
- String message = Text.prefix(response.isPunished() ? Sentinel.getInstance().getDirector().io.lang.violations.chat.url.autoPunishWarning : Sentinel.getInstance().getDirector().io.lang.violations.chat.url.preventWarning);
- String hoverText = Sentinel.getInstance().getDirector().io.lang.automatedActions.reportable;
+ Component message = Text.getMessageAny(
+ Text.Pallet.INFO,
+ response.isPunished() ? main.dir().io.lang.violations.chat.url.autoPunishWarning :
+ main.dir().io.lang.violations.chat.url.preventWarning
+ );
+ String hoverText = main.dir().io.lang.automatedActions.reportable;
String command = "/sentinelcallback fpreport %s".formatted(response.getReport().getId());
- response.getPlayer().sendMessage(Component.text(message)
+ Text.message(Text.Pallet.INFO, response.getPlayer(), message
.hoverEvent(Component.text(hoverText).asHoverEvent())
- .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND,command)));
+ .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.RUN_COMMAND, command))
+ );
}
@Override
protected Node buildTree(UrlResponse response) {
Node root = new Node("Sentinel");
- root.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.url.treeTitle);
+ root.addTextLine(Text.format(Text.Pallet.NEUTRAL,Component.text(main.dir().io.lang.violations.chat.url.treeTitle),response.getPlayer().name()));
- Node playerInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
- playerInfo.addKeyValue(Sentinel.getInstance().getDirector().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
+ Node playerInfo = new Node(main.dir().io.lang.violations.protections.infoNode.playerInfo.formatted(response.getPlayer().getName()));
+ playerInfo.addKeyValue(main.dir().io.lang.violations.protections.infoNode.uuid, response.getPlayer().getUniqueId().toString());
root.addChild(playerInfo);
- Node reportInfo = new Node(Sentinel.getInstance().getDirector().io.lang.violations.chat.url.reportInfoTitle);
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
- reportInfo.addField(Sentinel.getInstance().getDirector().io.lang.violations.chat.highlightedMessage, response.getHighlightedMessage());
+ Node reportInfo = new Node(main.dir().io.lang.violations.chat.url.reportInfoTitle);
+ reportInfo.addField(main.dir().io.lang.violations.chat.originalMessage, response.getOriginalMessage());
+ reportInfo.addField(Component.text(main.dir().io.lang.violations.chat.highlightedMessage), Node.parseLegacyText(response.getHighlightedMessage()));
root.addChild(reportInfo);
- Node actions = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.actionNodeTitle);
- actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.chat.denyMessage);
- if (response.isPunished()) actions.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
+ Node actions = new Node(main.dir().io.lang.violations.protections.actionNode.actionNodeTitle);
+ actions.addTextLine(main.dir().io.lang.violations.chat.denyMessage);
+ if (response.isPunished()) actions.addTextLine(main.dir().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
root.addChild(actions);
return root;
@@ -65,6 +72,6 @@ public class UrlAction extends AbstractActionHandler {
@Override
protected boolean shouldWarnPlayer(UrlResponse response) {
- return !Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.silent;
+ return !main.dir().io.mainConfig.chat.urlFilter.silent;
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlResponse.java b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlResponse.java
index 8f9cdf5..c6e357b 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlResponse.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/chatfilter/url/UrlResponse.java
@@ -2,12 +2,11 @@ package me.trouper.sentinel.server.functions.chatfilter.url;
import io.github.retrooper.packetevents.adventure.serializer.legacy.LegacyComponentSerializer;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.Emojis;
+import me.trouper.sentinel.data.types.Emojis;
import me.trouper.sentinel.server.functions.chatfilter.FilterResponse;
import me.trouper.sentinel.server.functions.helpers.Report;
+import me.trouper.sentinel.utils.FormatUtils;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.entity.Player;
import java.util.regex.Matcher;
@@ -35,9 +34,9 @@ public class UrlResponse implements FilterResponse {
}
String message = LegacyComponentSerializer.legacySection().serialize(e.message());
- Report report = Sentinel.getInstance().getDirector().reportHandler.initializeReport(message);
+ Report report = main.dir().reportHandler.initializeReport(message);
UrlResponse response = new UrlResponse(e,message,message,report,false,false);
- for (String allowed : Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.whitelist) {
+ for (String allowed : main.dir().io.mainConfig.chat.urlFilter.whitelist) {
message = message.replaceAll(allowed,"");
}
@@ -45,7 +44,7 @@ public class UrlResponse implements FilterResponse {
message
));
- String urlRegex = Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.regex;
+ String urlRegex = main.dir().io.mainConfig.chat.urlFilter.regex;
Pattern pattern = Pattern.compile(urlRegex, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(message);
@@ -55,12 +54,12 @@ public class UrlResponse implements FilterResponse {
));
if (matcher.find()) {
- String highlighted = Text.regexHighlighter(message,Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.regex," > "," < ");
+ String highlighted = FormatUtils.regexHighlighter(message,main.dir().io.mainConfig.chat.urlFilter.regex,"█HS█","█HE█");
ServerUtils.verbose("Caught URL: " + highlighted);
response.getReport().getStepsTaken().replace("Anti-URL", "`%s` %s".formatted(highlighted, Emojis.alarm));
response.setBlocked(true);
- response.setPunished(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punished);
+ response.setPunished(main.dir().io.mainConfig.chat.urlFilter.punished);
response.setHighlightedMessage(highlighted);
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/helpers/ActionConfiguration.java b/src/main/java/me/trouper/sentinel/server/functions/helpers/ActionConfiguration.java
index 214a62a..2131e5d 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/helpers/ActionConfiguration.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/helpers/ActionConfiguration.java
@@ -1,7 +1,7 @@
package me.trouper.sentinel.server.functions.helpers;
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.utils.ServerUtils;
import me.trouper.sentinel.utils.trees.Node;
import org.bukkit.Material;
@@ -14,7 +14,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
-public class ActionConfiguration {
+public class ActionConfiguration implements Main {
private Player player;
private boolean deop;
private Cancellable event;
@@ -162,7 +162,7 @@ public class ActionConfiguration {
private boolean punish;
private List punishmentCommands = new ArrayList<>();
private boolean logToDiscord;
- private Node actionNode = new Node(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.actionNodeTitle);
+ private Node actionNode = new Node(main.dir().io.lang.violations.protections.actionNode.actionNodeTitle);
private List> actions = new ArrayList<>();
@@ -179,7 +179,7 @@ public class ActionConfiguration {
if (config.player != null) {
config.player.setOp(false);
}
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.userDeoped);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.userDeoped);
});
return this;
}
@@ -197,7 +197,7 @@ public class ActionConfiguration {
if (config.event != null) {
config.event.setCancelled(true);
}
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.eventCancelled);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.eventCancelled);
});
return this;
}
@@ -214,7 +214,7 @@ public class ActionConfiguration {
config.destroyBlock = destroyBlock;
if (config.block != null) {
config.block.setType(Material.AIR);
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.destroyedBlock);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.destroyedBlock);
}
});
return this;
@@ -225,11 +225,11 @@ public class ActionConfiguration {
actions.add(config -> {
config.restoreBlock = restoreBlock;
if (config.block != null) {
- CommandBlockHolder holder = Sentinel.getInstance().getDirector().whitelistManager.getFromList(config.block.getLocation());
+ CommandBlockHolder holder = main.dir().whitelistManager.getFromList(config.block.getLocation());
if (holder != null && holder.restore()) {
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.restore);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.restore);
} else {
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.restoreFailed);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.restoreFailed);
}
}
});
@@ -267,7 +267,7 @@ public class ActionConfiguration {
for (String cmd : punishmentCommands) {
ServerUtils.sendCommand(cmd.replaceAll("%player%", config.player.getName()));
}
- config.actionNode.addTextLine(Sentinel.getInstance().getDirector().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
+ config.actionNode.addTextLine(main.dir().io.lang.violations.protections.actionNode.punishmentCommandsExecuted);
}
});
return this;
diff --git a/src/main/java/me/trouper/sentinel/server/functions/helpers/CBWhitelistManager.java b/src/main/java/me/trouper/sentinel/server/functions/helpers/CBWhitelistManager.java
index c5502e9..0f30e64 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/helpers/CBWhitelistManager.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/helpers/CBWhitelistManager.java
@@ -1,12 +1,12 @@
package me.trouper.sentinel.server.functions.helpers;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
-import me.trouper.sentinel.data.misc.Selection;
-import me.trouper.sentinel.data.misc.SerialLocation;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
+import me.trouper.sentinel.data.types.Selection;
+import me.trouper.sentinel.data.types.SerialLocation;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.events.admin.WandEvents;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -21,7 +21,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
-public class CBWhitelistManager {
+public class CBWhitelistManager implements Main {
public Set autoWhitelist = new HashSet<>();
@@ -50,7 +50,7 @@ public class CBWhitelistManager {
public void removeSelectionFromWhitelist(Player player) {
Selection selection = WandEvents.selections.get(player.getUniqueId());
if (selection == null || !selection.isComplete()) {
- player.sendMessage(Text.prefix("You must set 2 points first."));
+ errorAny(player,"You must set 2 points first.");
return;
}
AtomicInteger number = new AtomicInteger();
@@ -61,13 +61,13 @@ public class CBWhitelistManager {
}
});
- player.sendMessage(Text.prefix("Removed all &b%s&7 command blocks from the whitelist in your selection.".formatted(number.get())));
+ successAny(player,"Removed all {0} command blocks from the whitelist in your selection.",number.get());
}
public void deleteSelection(Player player) {
Selection selection = WandEvents.selections.get(player.getUniqueId());
if (selection == null || !selection.isComplete()) {
- player.sendMessage(Text.prefix("You must set 2 points first."));
+ errorAny(player,"You must set 2 points first.");
return;
}
AtomicInteger number = new AtomicInteger();
@@ -78,13 +78,13 @@ public class CBWhitelistManager {
}
});
- player.sendMessage(Text.prefix("Deleted all &b%s&7 command blocks from the whitelist in your selection.".formatted(number.get())));
+ successAny(player,"Deleted all {0} command blocks from the whitelist in your selection.",number.get());
}
public void addSelectionToWhitelist(Player player) {
Selection selection = WandEvents.selections.get(player.getUniqueId());
if (selection == null || !selection.isComplete()) {
- player.sendMessage(Text.prefix("You must set 2 points first."));
+ errorAny(player,"You must set 2 points first.");
return;
}
@@ -96,12 +96,12 @@ public class CBWhitelistManager {
}
});
- player.sendMessage(Text.prefix("Whitelisted all &b%s&7 command blocks in your selection.".formatted(number.get())));
+ successAny(player,"Whitelisted all {0} command blocks in your selection.",number.get());
}
public int clearAll() {
int total = 0;
- for (CommandBlockHolder cb : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder cb : main.dir().io.whitelistStorage.holders) {
cb.destroy();
cb.delete();
total++;
@@ -115,7 +115,7 @@ public class CBWhitelistManager {
public int clearAll(UUID who) {
int total = 0;
- for (CommandBlockHolder cb : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder cb : main.dir().io.whitelistStorage.holders) {
if (!cb.owner().equals(who.toString())) continue;
cb.destroy();
cb.delete();
@@ -130,7 +130,7 @@ public class CBWhitelistManager {
public int restoreAll() {
int total = 0;
- for (CommandBlockHolder cb : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder cb : main.dir().io.whitelistStorage.holders) {
if (cb.isWhitelisted() && cb.restore()) total++;
}
return total;
@@ -138,7 +138,7 @@ public class CBWhitelistManager {
public int restoreAll(UUID who) {
int total = 0;
- for (CommandBlockHolder cb : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder cb : main.dir().io.whitelistStorage.holders) {
if (!cb.owner().equals(who.toString())) continue;
if (cb.isWhitelisted() && cb.restore()) total++;
}
@@ -165,7 +165,7 @@ public class CBWhitelistManager {
}
public CommandBlockHolder getFromList(UUID entityUUID) {
- for (CommandBlockHolder existing : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder existing : main.dir().io.whitelistStorage.holders) {
if (existing.loc().isUUID() && existing.loc().toUIID().equals(entityUUID)) {
return existing;
}
@@ -174,7 +174,7 @@ public class CBWhitelistManager {
}
public CommandBlockHolder getFromList(Location loc) {
- for (CommandBlockHolder existing : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder existing : main.dir().io.whitelistStorage.holders) {
if (existing.loc().isSameLocation(loc)) {
return existing;
}
@@ -183,7 +183,7 @@ public class CBWhitelistManager {
}
public CommandBlockHolder getFromList(SerialLocation loc) {
- for (CommandBlockHolder existing : Sentinel.getInstance().getDirector().io.whitelistStorage.holders) {
+ for (CommandBlockHolder existing : main.dir().io.whitelistStorage.holders) {
if (existing.loc().isSameLocation(loc)) {
return existing;
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/helpers/MessageHandler.java b/src/main/java/me/trouper/sentinel/server/functions/helpers/MessageHandler.java
index 82a2242..7060132 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/helpers/MessageHandler.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/helpers/MessageHandler.java
@@ -4,6 +4,7 @@ import io.github.itzispyder.pdk.utils.ServerUtils;
import io.papermc.paper.chat.ChatRenderer;
import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.commands.SentinelCommand;
import me.trouper.sentinel.server.events.violations.players.ChatEvent;
import net.kyori.adventure.chat.SignedMessage;
@@ -13,7 +14,7 @@ import org.bukkit.entity.Player;
import java.util.*;
-public class MessageHandler {
+public class MessageHandler implements Main {
public final Map replyMap = new HashMap<>();
public void messagePlayer(Player sender, Player receiver, String message) {
AsyncChatEvent checkEvent = new AsyncChatEvent(true,sender, new HashSet<>(Arrays.asList(receiver, sender)), ChatRenderer.defaultRenderer(),Component.text(message),Component.text(message), SignedMessage.system(message,Component.text(message)));
@@ -21,8 +22,8 @@ public class MessageHandler {
new ChatEvent().handleEvent(checkEvent);
if (checkEvent.isCancelled()) return;
- sender.sendMessage(Sentinel.getInstance().getDirector().io.lang.playerInteraction.messageSent.formatted(receiver.getName(),message));
- receiver.sendMessage(Sentinel.getInstance().getDirector().io.lang.playerInteraction.messageReceived.formatted(sender.getName(),message));
+ sender.sendMessage(main.dir().io.lang.playerInteraction.messageSent.formatted(receiver.getName(),message)); // This "sendMessage" call is correct
+ receiver.sendMessage(main.dir().io.lang.playerInteraction.messageReceived.formatted(sender.getName(),message)); // This "sendMessage" call is correct
replyMap.put(receiver.getUniqueId(),sender.getUniqueId());
sendSpy(sender,receiver,message);
}
@@ -32,9 +33,9 @@ public class MessageHandler {
if (SentinelCommand.spyMap.getOrDefault(player.getUniqueId(),false)) {
TextComponent notification = Component
- .text(Sentinel.getInstance().getDirector().io.lang.socialSpy.spyMessage.formatted(sender.getName(),receiver.getName()))
- .hoverEvent(Component.text(Sentinel.getInstance().getDirector().io.lang.socialSpy.spyMessageHover.formatted(sender.getName(),receiver.getName(),message)));
- player.sendMessage(notification);
+ .text(main.dir().io.lang.socialSpy.spyMessage.formatted(sender.getName(),receiver.getName()))
+ .hoverEvent(Component.text(main.dir().io.lang.socialSpy.spyMessageHover.formatted(sender.getName(),receiver.getName(),message)));
+ player.sendMessage(notification); // This "sendMessage" call is correct
}
});
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/helpers/Report.java b/src/main/java/me/trouper/sentinel/server/functions/helpers/Report.java
index 7f70aa3..08c2d44 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/helpers/Report.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/helpers/Report.java
@@ -37,4 +37,8 @@ public class Report {
public void setStepsTaken(LinkedHashMap stepsTaken) {
this.stepsTaken = stepsTaken;
}
+
+ public void addStep(String name, String step) {
+ getStepsTaken().put(name,step);
+ }
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/helpers/ReportHandler.java b/src/main/java/me/trouper/sentinel/server/functions/helpers/ReportHandler.java
index 6bac209..3158efd 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/helpers/ReportHandler.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/helpers/ReportHandler.java
@@ -2,7 +2,7 @@ package me.trouper.sentinel.server.functions.helpers;
import io.github.itzispyder.pdk.utils.SchedulerUtils;
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
-import me.trouper.sentinel.data.misc.Emojis;
+import me.trouper.sentinel.data.types.Emojis;
import me.trouper.sentinel.utils.RandomUtils;
import me.trouper.sentinel.utils.trees.EmbedFormatter;
import org.bukkit.entity.Player;
diff --git a/src/main/java/me/trouper/sentinel/server/functions/hotbar/AbstractCheck.java b/src/main/java/me/trouper/sentinel/server/functions/hotbar/AbstractCheck.java
index 4796ad2..5fa7b59 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/hotbar/AbstractCheck.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/hotbar/AbstractCheck.java
@@ -2,8 +2,9 @@ package me.trouper.sentinel.server.functions.hotbar;
import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.NBTConfig;
+import me.trouper.sentinel.server.Main;
-public abstract class AbstractCheck {
- public NBTConfig config = Sentinel.getInstance().getDirector().io.nbtConfig;
+public abstract class AbstractCheck implements Main {
+ public NBTConfig config = main.dir().io.nbtConfig;
public abstract boolean passes(T input);
}
diff --git a/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/EnchantmentCheck.java b/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/EnchantmentCheck.java
index bbaaacb..7d4275d 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/EnchantmentCheck.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/EnchantmentCheck.java
@@ -26,7 +26,7 @@ public class EnchantmentCheck extends AbstractCheck {
for (Map.Entry entry : enchantments.entrySet()) {
Enchantment enchantment = entry.getKey();
int level = entry.getValue();
- if (level > Sentinel.getInstance().getDirector().io.nbtConfig.globalMaxEnchant || isOverLimit(enchantment, level)) {
+ if (level > main.dir().io.nbtConfig.globalMaxEnchant || isOverLimit(enchantment, level)) {
return true;
}
}
@@ -35,92 +35,92 @@ public class EnchantmentCheck extends AbstractCheck {
}
public static boolean isOverLimit(Enchantment enchantment, int level) {
- int maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.globalMaxEnchant;
+ int maxLevel = main.dir().io.nbtConfig.globalMaxEnchant;
if (enchantment.equals(MENDING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxMending;
+ maxLevel = main.dir().io.nbtConfig.maxMending;
} else if (enchantment.equals(Enchantment.UNBREAKING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxUnbreaking;
+ maxLevel = main.dir().io.nbtConfig.maxUnbreaking;
} else if (enchantment.equals(Enchantment.VANISHING_CURSE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxCurseOfVanishing;
+ maxLevel = main.dir().io.nbtConfig.maxCurseOfVanishing;
} else if (enchantment.equals(Enchantment.BINDING_CURSE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxCurseOfBinding;
+ maxLevel = main.dir().io.nbtConfig.maxCurseOfBinding;
} else if (enchantment.equals(Enchantment.AQUA_AFFINITY)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxAquaAffinity;
+ maxLevel = main.dir().io.nbtConfig.maxAquaAffinity;
} else if (enchantment.equals(Enchantment.PROTECTION)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxProtection;
+ maxLevel = main.dir().io.nbtConfig.maxProtection;
} else if (enchantment.equals(Enchantment.BLAST_PROTECTION)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxBlastProtection;
+ maxLevel = main.dir().io.nbtConfig.maxBlastProtection;
} else if (enchantment.equals(Enchantment.DEPTH_STRIDER)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxDepthStrider;
+ maxLevel = main.dir().io.nbtConfig.maxDepthStrider;
} else if (enchantment.equals(Enchantment.FEATHER_FALLING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFeatherFalling;
+ maxLevel = main.dir().io.nbtConfig.maxFeatherFalling;
} else if (enchantment.equals(Enchantment.FIRE_PROTECTION)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFireProtection;
+ maxLevel = main.dir().io.nbtConfig.maxFireProtection;
} else if (enchantment.equals(Enchantment.FROST_WALKER)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFrostWalker;
+ maxLevel = main.dir().io.nbtConfig.maxFrostWalker;
} else if (enchantment.equals(Enchantment.PROJECTILE_PROTECTION)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxProjectileProtection;
+ maxLevel = main.dir().io.nbtConfig.maxProjectileProtection;
} else if (enchantment.equals(Enchantment.RESPIRATION)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxRespiration;
+ maxLevel = main.dir().io.nbtConfig.maxRespiration;
} else if (enchantment.equals(Enchantment.SOUL_SPEED)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSoulSpeed;
+ maxLevel = main.dir().io.nbtConfig.maxSoulSpeed;
} else if (enchantment.equals(Enchantment.THORNS)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxThorns;
+ maxLevel = main.dir().io.nbtConfig.maxThorns;
} else if (enchantment.equals(Enchantment.SWEEPING_EDGE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSweepingEdge;
+ maxLevel = main.dir().io.nbtConfig.maxSweepingEdge;
} else if (enchantment.equals(Enchantment.SWIFT_SNEAK)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSwiftSneak;
+ maxLevel = main.dir().io.nbtConfig.maxSwiftSneak;
} else if (enchantment.equals(Enchantment.BANE_OF_ARTHROPODS)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxBaneOfArthropods;
+ maxLevel = main.dir().io.nbtConfig.maxBaneOfArthropods;
} else if (enchantment.equals(Enchantment.FIRE_ASPECT)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFireAspect;
+ maxLevel = main.dir().io.nbtConfig.maxFireAspect;
} else if (enchantment.equals(Enchantment.LOOTING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxLooting;
+ maxLevel = main.dir().io.nbtConfig.maxLooting;
} else if (enchantment.equals(Enchantment.IMPALING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxImpaling;
+ maxLevel = main.dir().io.nbtConfig.maxImpaling;
} else if (enchantment.equals(Enchantment.KNOCKBACK)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxKnockback;
+ maxLevel = main.dir().io.nbtConfig.maxKnockback;
} else if (enchantment.equals(Enchantment.SHARPNESS)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSharpness;
+ maxLevel = main.dir().io.nbtConfig.maxSharpness;
} else if (enchantment.equals(Enchantment.SMITE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSmite;
+ maxLevel = main.dir().io.nbtConfig.maxSmite;
} else if (enchantment.equals(Enchantment.CHANNELING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxChanneling;
+ maxLevel = main.dir().io.nbtConfig.maxChanneling;
} else if (enchantment.equals(Enchantment.FLAME)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFlame;
+ maxLevel = main.dir().io.nbtConfig.maxFlame;
} else if (enchantment.equals(Enchantment.INFINITY)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxInfinity;
+ maxLevel = main.dir().io.nbtConfig.maxInfinity;
} else if (enchantment.equals(Enchantment.LOYALTY)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxLoyalty;
+ maxLevel = main.dir().io.nbtConfig.maxLoyalty;
} else if (enchantment.equals(Enchantment.RIPTIDE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxRiptide;
+ maxLevel = main.dir().io.nbtConfig.maxRiptide;
} else if (enchantment.equals(Enchantment.MULTISHOT)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxMultishot;
+ maxLevel = main.dir().io.nbtConfig.maxMultishot;
} else if (enchantment.equals(Enchantment.PIERCING)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxPiercing;
+ maxLevel = main.dir().io.nbtConfig.maxPiercing;
} else if (enchantment.equals(Enchantment.POWER)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxPower;
+ maxLevel = main.dir().io.nbtConfig.maxPower;
} else if (enchantment.equals(Enchantment.PUNCH)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxPunch;
+ maxLevel = main.dir().io.nbtConfig.maxPunch;
} else if (enchantment.equals(Enchantment.QUICK_CHARGE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxQuickCharge;
+ maxLevel = main.dir().io.nbtConfig.maxQuickCharge;
} else if (enchantment.equals(Enchantment.EFFICIENCY)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxEfficiency;
+ maxLevel = main.dir().io.nbtConfig.maxEfficiency;
} else if (enchantment.equals(Enchantment.FORTUNE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxFortune;
+ maxLevel = main.dir().io.nbtConfig.maxFortune;
} else if (enchantment.equals(Enchantment.LUCK_OF_THE_SEA)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxLuckOfTheSea;
+ maxLevel = main.dir().io.nbtConfig.maxLuckOfTheSea;
} else if (enchantment.equals(Enchantment.LURE)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxLure;
+ maxLevel = main.dir().io.nbtConfig.maxLure;
} else if (enchantment.equals(Enchantment.SILK_TOUCH)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxSilkTouch;
+ maxLevel = main.dir().io.nbtConfig.maxSilkTouch;
} else if (enchantment.equals(Enchantment.BREACH)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxBreach;
+ maxLevel = main.dir().io.nbtConfig.maxBreach;
} else if (enchantment.equals(Enchantment.DENSITY)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxDensity;
+ maxLevel = main.dir().io.nbtConfig.maxDensity;
} else if (enchantment.equals(Enchantment.WIND_BURST)) {
- maxLevel = Sentinel.getInstance().getDirector().io.nbtConfig.maxWindBurst;
+ maxLevel = main.dir().io.nbtConfig.maxWindBurst;
}
return level > maxLevel;
diff --git a/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/RateLimitCheck.java b/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/RateLimitCheck.java
index f77981a..9323e0b 100644
--- a/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/RateLimitCheck.java
+++ b/src/main/java/me/trouper/sentinel/server/functions/hotbar/items/RateLimitCheck.java
@@ -1,5 +1,6 @@
package me.trouper.sentinel.server.functions.hotbar.items;
+import de.tr7zw.changeme.nbtapi.NBT;
import de.tr7zw.changeme.nbtapi.NBTItem;
import io.github.itzispyder.pdk.utils.misc.Pair;
import me.trouper.sentinel.Sentinel;
@@ -25,10 +26,10 @@ public class RateLimitCheck extends AbstractCheck> {
UUID uuid = player.getUniqueId();
ItemStack item = input.right;
- return itemLimit(player,uuid,item) && dataLimit(player,uuid,item);
+ return itemLimit(uuid,item) && dataLimit(uuid,item);
}
- private boolean itemLimit(Player player, UUID uuid, ItemStack item) {
+ private boolean itemLimit(UUID uuid, ItemStack item) {
int currentUsed = itemsUsed.getOrDefault(uuid,0);
ServerUtils.verbose("Current Player used items: " + currentUsed);
currentUsed++;
@@ -37,13 +38,12 @@ public class RateLimitCheck extends AbstractCheck> {
}
- private boolean dataLimit(Player player, UUID uuid, ItemStack item) {
+ private boolean dataLimit(UUID uuid, ItemStack item) {
int currentData = dataUsed.getOrDefault(uuid,0);
ServerUtils.verbose("Current Player used data: " + currentData);
try {
- NBTItem nbt = new NBTItem(item);
- int itemData = nbt.toString().length();
+ int itemData = NBT.readNbt(item).toString().length();
ServerUtils.verbose("Item data: " + itemData);
if (currentData < config.rateLimit.maxOverhead) currentData += itemData;
} catch (Exception e) {
diff --git a/src/main/java/me/trouper/sentinel/server/gui/Items.java b/src/main/java/me/trouper/sentinel/server/gui/Items.java
index 32ff3e8..f9c7ee2 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/Items.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/Items.java
@@ -1,9 +1,17 @@
package me.trouper.sentinel.server.gui;
-import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.utils.ItemBuilder;
import me.trouper.sentinel.utils.ServerUtils;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.TextReplacementConfig;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.Style;
+import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
@@ -17,147 +25,171 @@ public class Items {
public static final ItemStack BLANK = ItemBuilder.create()
.material(Material.LIGHT_GRAY_STAINED_GLASS_PANE)
- .name(Text.color("&7"))
+ .displayName(Component.empty())
.build();
public static final ItemStack GREEN = ItemBuilder.create()
.material(Material.LIME_STAINED_GLASS_PANE)
- .name(Text.color("&7"))
+ .displayName(Component.empty())
.build();
public static final ItemStack RED = ItemBuilder.create()
.material(Material.RED_STAINED_GLASS_PANE)
- .name(Text.color("&7"))
+ .displayName(Component.empty())
.build();
public static final ItemStack BACK = ItemBuilder.create()
.material(Material.ARROW)
- .name(Text.color("&cBack"))
- .lore(Text.color("&8&l➥&7 Return to the previous page"))
+ .displayName(Component.text("Back",NamedTextColor.RED).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Text.color("&8&l➥&7 Return to the previous page"))
.build();
public static final ItemStack CREDITS = ItemBuilder.create()
.material(Material.SHIELD)
- .name(Text.color("&6&lSentinel &8&l|&f Anti-Nuke"))
- .lore(" ")
- .lore(Text.color("&bVersion&7: &f%s".formatted(Sentinel.getInstance().version)))
- .lore(Text.color("&bLicensed to&7: &f%s".formatted(Sentinel.getInstance().nonce)))
- .lore(" ")
- .lore(Text.color("&e&nAuthor(s)&r&e: &e%s").formatted(Sentinel.getInstance().getPluginMeta().getAuthors()))
+ .displayName(Text.color("&6&lSentinel &8&l|&f Anti-Nuke").decoration(TextDecoration.ITALIC,false))
+ .loreComponent(
+ Component.empty(),
+ Text.color("&bVersion&7: &f%s".formatted(Sentinel.getInstance().version)),
+ Text.color("&bLicensed to&7: &f%s".formatted(Sentinel.getInstance().nonce)),
+ Component.empty(),
+ Text.color("&e&nAuthor(s)&r&e: &e%s".formatted(Sentinel.getInstance().getPluginMeta().getAuthors()))
+ )
.enchant(Enchantment.PROTECTION,64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
public static final ItemStack CONFIG = ItemBuilder.create()
+ .displayName(Component.text("Edit Config",Style.style(TextDecoration.BOLD, NamedTextColor.GOLD)).decoration(TextDecoration.ITALIC,false))
.material(Material.PISTON)
- .name(Text.color("&6&lEdit Config"))
- .lore(Text.color("&8&l➥&7 Click this if you hate JSON."))
+ .loreComponent(Text.color("&8&l➥&7 Click this if you hate JSON."))
.enchant(Enchantment.PROTECTION,64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
public static final ItemStack CHAT_CONFIG = ItemBuilder.create()
.material(Material.HOPPER)
- .name(Text.color("&bChat Config"))
- .lore(Text.color("&8&l➥&7 Spam Filter"))
- .lore(Text.color("&8&l➥&7 Profanity Filter"))
- .lore(Text.color("&8&l➥&7 Unicode Filter"))
- .lore(Text.color("&8&l➥&7 URL Filter"))
+ .displayName(Component.text("Chat Config",NamedTextColor.AQUA).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(
+ Text.color("&8&l➥&7 Spam Filter"),
+ Text.color("&8&l➥&7 Profanity Filter"),
+ Text.color("&8&l➥&7 Unicode Filter"),
+ Text.color("&8&l➥&7 URL Filter")
+ )
.enchant(Enchantment.PROTECTION,64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
public static final ItemStack ANTI_NUKE_CONFIG = ItemBuilder.create()
.material(Material.TNT)
- .name(Text.color("&cAnti-Nuke Config"))
- .lore(Text.color("&8&l➥&7 Manage all violations"))
- .enchant(Enchantment.PROTECTION,64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .displayName(Component.text("Anti-Nuke Config", NamedTextColor.RED).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Text.color("&8&l➥&7 Manage all violations"))
+ .enchant(Enchantment.PROTECTION, 64)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
-
+
public static final ItemStack WHITELIST = ItemBuilder.create()
.material(Material.TNT)
- .name(Text.color("&aCommand Block Whitelist"))
- .lore(Text.color("&8&l➥&7 Manage running command blocks"))
+ .displayName(Component.text("Command Block Whitelist", NamedTextColor.GREEN).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Text.color("&8&l➥&7 Manage running command blocks"))
.enchant(Enchantment.PROTECTION, 64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
+
public static final ItemStack NBT = ItemBuilder.create()
.material(Material.HONEY_BOTTLE)
- .name(Text.color("&aNBT Honeypot"))
- .lore(Text.color("&8&l➥&7 View caught NBT"))
+ .displayName(Component.text("NBT Honeypot", NamedTextColor.GREEN).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(Text.color("&8&l➥&7 View caught NBT"))
.enchant(Enchantment.PROTECTION, 64)
- .flag(ItemFlag.HIDE_ENCHANTS)
+ .flags(ItemFlag.HIDE_ENCHANTS)
.build();
public static ItemStack configItem(String valueName, Material material, String description) {
- ServerUtils.verbose("Creating a config item:\n Value Name -> %s\nMaterial in use -> %s".formatted(valueName,material.toString()));
+ ServerUtils.verbose("Creating a config item:\n Value Name -> %s\nMaterial in use -> %s",
+ valueName, material.toString());
List desc = Arrays.stream(description.split("\n")).toList();
- ItemBuilder item = ItemBuilder.create();
- item.material(material);
- item.name(Text.color("&6%s".formatted(valueName)));
+ ItemBuilder item = ItemBuilder.create()
+ .material(material)
+ .displayName(Component.text(valueName, NamedTextColor.GOLD).decoration(TextDecoration.ITALIC,false));
+
for (String s : desc) {
- item.lore(Text.color("&e%s".formatted(s)));
+ item.loreComponent(Component.text(s, NamedTextColor.YELLOW));
}
- item.lore(Text.color("&8&l➥&7 Click to set a &nnew&r&7 value."));
- item.lore(Text.color("&8&l➥&7 Current Value: &b_ORIGINAL_"));
+
+ item.loreComponent(
+ Text.color("&8&l➥&7 Click to set a &nnew&r&7 value."),
+ Text.color("&8&l➥&7 Current Value: &b_ORIGINAL_")
+ );
return item.build();
}
-
-
public static ItemStack stringListItem(Iterable values, Material material, String valueName, String description) {
- ServerUtils.verbose("Items#stringListItem: Creating a config item:\n Value Name -> %s\nMaterial in use -> %s".formatted(valueName,material.toString()));
- ItemBuilder itemBuilder = ItemBuilder.create();
- itemBuilder.material(material);
- itemBuilder.name(Text.color("&6%s".formatted(valueName)));
+ ServerUtils.verbose("Items#stringListItem: Creating a config item:\n Value Name -> %s\nMaterial in use -> %s",
+ valueName, material.toString());
+
+ ItemBuilder itemBuilder = ItemBuilder.create()
+ .material(material)
+ .displayName(Component.text(valueName, NamedTextColor.GOLD).decoration(TextDecoration.ITALIC,false));
+
List desc = Arrays.stream(description.split("\n")).toList();
for (String s : desc) {
- itemBuilder.lore(Text.color("&e%s".formatted(s)));
+ itemBuilder.loreComponent(Component.text(s, NamedTextColor.YELLOW));
}
- itemBuilder.lore(Text.color("&8&l➥&7 Left-Click to add a new value."));
- itemBuilder.lore(Text.color("&8&l➥&7 Right-Click to clear values."));
- itemBuilder.lore(Text.color("&8&l➥&7 Current Values: "));
- itemBuilder.flag(ItemFlag.HIDE_ATTRIBUTES);
+
+ itemBuilder.loreComponent(
+ Text.color("&8&l➥&7 Left-Click to add a new value."),
+ Text.color("&8&l➥&7 Right-Click to clear values."),
+ Text.color("&8&l➥&7 Current Values: ")
+ ).flags(ItemFlag.HIDE_ATTRIBUTES);
for (String value : values) {
- itemBuilder.lore(Text.color("&9 - &b%s".formatted(value)));
+ itemBuilder.loreComponent(
+ Component.text(" - ", NamedTextColor.BLUE)
+ .append(Component.text(value, NamedTextColor.AQUA))
+ );
}
return itemBuilder.build();
}
public static ItemStack stringItem(String originalValue, ItemStack originalItem) {
- ServerUtils.verbose("Items#stringItem Creating a string item:\n Value -> %s".formatted(originalValue));
+ ServerUtils.verbose("Items#stringItem Creating a string item:\n Value -> %s", originalValue);
if (originalItem == null || !originalItem.hasItemMeta()) return originalItem;
ItemMeta meta = originalItem.getItemMeta();
- if (meta == null || !meta.hasLore()) return originalItem;
- List lore = meta.getLore();
+ if (meta == null) return originalItem;
+
+ List lore = meta.lore();
if (lore == null) return originalItem;
for (int i = 0; i < lore.size(); i++) {
- String line = lore.get(i);
- ServerUtils.verbose("Items#stringItem Looping through lore line: %s/%s".formatted(i,lore.size()));
- if (line.contains("_ORIGINAL_")) {
+ Component line = lore.get(i);
+ String plainText = PlainTextComponentSerializer.plainText().serialize(line);
+
+ ServerUtils.verbose("Items#stringItem Looping through lore line: %s/%s", i, lore.size());
+
+ if (plainText.contains("_ORIGINAL_")) {
try {
- ServerUtils.verbose("Items#stringItem Found a lore on line %s, making replacement value".formatted(i));
- String replace = line.replace("_ORIGINAL_", originalValue);
- ServerUtils.verbose("Items#stringItem After replacement -> %s".formatted(replace));
- lore.set(i,replace);
- ServerUtils.verbose("Items#stringItem Just replaced line %s -> %s".formatted(i,lore.get(i)));
+ ServerUtils.verbose("Items#stringItem Found a lore on line %s, making replacement value", i);
+
+ Component newLine = line.replaceText(TextReplacementConfig.builder()
+ .matchLiteral("_ORIGINAL_")
+ .replacement(originalValue)
+ .build());
+
+ lore.set(i, newLine);
+ ServerUtils.verbose("Items#stringItem Just replaced line %s", i);
} catch (Exception e) {
e.printStackTrace();
}
}
- ServerUtils.verbose("Items#stringItem end of loop %s. continue?".formatted(i));
+ ServerUtils.verbose("Items#stringItem end of loop %s. continue?", i);
}
ServerUtils.verbose("Items#stringItem Broke out of loop, setting the lore");
- meta.setLore(lore);
+ meta.lore(lore);
ServerUtils.verbose("Items#stringItem Setting the meta");
originalItem.setItemMeta(meta);
ServerUtils.verbose("Items#stringItem Returning the item");
@@ -165,70 +197,52 @@ public class Items {
}
public static ItemStack booleanItem(boolean originalValue, ItemStack originalItem) {
- ServerUtils.verbose("Items#booleanItem Creating a string item:\n Value -> %s".formatted(originalValue));
-
- if (originalItem == null || !originalItem.hasItemMeta()) return originalItem;
- ItemMeta meta = originalItem.getItemMeta();
- if (meta == null || !meta.hasLore()) return originalItem;
- List lore = meta.getLore();
- if (lore == null) return originalItem;
-
- for (int i = 0; i < lore.size(); i++) {
- String line = lore.get(i);
- ServerUtils.verbose("Items#booleanItem Looping through lore line: %s/%s".formatted(i,lore.size()));
- if (line.contains("_ORIGINAL_")) {
- try {
- ServerUtils.verbose("Items#booleanItem Found a lore on line %s, making replacement value".formatted(i));
- String replace = line.replace("_ORIGINAL_", "" + originalValue);
- ServerUtils.verbose("Items#booleanItem After replacement -> %s".formatted(replace));
- lore.set(i,replace);
- ServerUtils.verbose("Items#booleanItem Just replaced line %s -> %s".formatted(i,lore.get(i)));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- ServerUtils.verbose("Items#booleanItem end of loop %s. continue?".formatted(i));
- }
-
- ServerUtils.verbose("Items#booleanItem Broke out of loop, setting the lore");
- meta.setLore(lore);
- ServerUtils.verbose("Items#booleanItem Setting the meta");
- originalItem.setItemMeta(meta);
- ServerUtils.verbose("Items#booleanItem Returning the item");
- return originalItem;
+ return replaceOriginalValue(String.valueOf(originalValue), originalItem, "booleanItem");
}
public static ItemStack intItem(int originalValue, ItemStack originalItem) {
- ServerUtils.verbose("Items#intitem Creating a string item:\n Value -> %s".formatted(originalValue));
+ return replaceOriginalValue(String.valueOf(originalValue), originalItem, "intItem");
+ }
+
+ private static ItemStack replaceOriginalValue(String value, ItemStack originalItem, String methodName) {
+ ServerUtils.verbose("Items#%s Creating item with value: %s", methodName, value);
if (originalItem == null || !originalItem.hasItemMeta()) return originalItem;
ItemMeta meta = originalItem.getItemMeta();
- if (meta == null || !meta.hasLore()) return originalItem;
- List lore = meta.getLore();
+ if (meta == null) return originalItem;
+
+ List lore = meta.lore();
if (lore == null) return originalItem;
for (int i = 0; i < lore.size(); i++) {
- String line = lore.get(i);
- ServerUtils.verbose("Items#intitem Looping through lore line: %s/%s".formatted(i,lore.size()));
- if (line.contains("_ORIGINAL_")) {
+ Component line = lore.get(i);
+ String plainText = PlainTextComponentSerializer.plainText().serialize(line);
+
+ ServerUtils.verbose("Items#%s Looping through lore line: %s/%s", methodName, i, lore.size());
+
+ if (plainText.contains("_ORIGINAL_")) {
try {
- ServerUtils.verbose("Items#intitem Found a lore on line %s, making replacement value".formatted(i));
- String replace = line.replace("_ORIGINAL_", "" + originalValue);
- ServerUtils.verbose("Items#intitem After replacement -> %s".formatted(replace));
- lore.set(i,replace);
- ServerUtils.verbose("Items#intitem Just replaced line %s -> %s".formatted(i,lore.get(i)));
+ ServerUtils.verbose("Items#%s Found a lore on line %s, making replacement value", methodName, i);
+
+ Component newLine = line.replaceText(TextReplacementConfig.builder()
+ .matchLiteral("_ORIGINAL_")
+ .replacement(value)
+ .build());
+
+ lore.set(i, newLine);
+ ServerUtils.verbose("Items#%s Just replaced line %s", methodName, i);
} catch (Exception e) {
e.printStackTrace();
}
}
- ServerUtils.verbose("Items#intitem end of loop %s. continue?".formatted(i));
+ ServerUtils.verbose("Items#%s end of loop %s. continue?", methodName, i);
}
- ServerUtils.verbose("Items#intitem Broke out of loop, setting the lore");
- meta.setLore(lore);
- ServerUtils.verbose("Items#intitem Setting the meta");
+ ServerUtils.verbose("Items#%s Broke out of loop, setting the lore", methodName);
+ meta.lore(lore);
+ ServerUtils.verbose("Items#%s Setting the meta", methodName);
originalItem.setItemMeta(meta);
- ServerUtils.verbose("Items#intitem Returning the item");
+ ServerUtils.verbose("Items#%s Returning the item", methodName);
return originalItem;
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/MainGUI.java b/src/main/java/me/trouper/sentinel/server/gui/MainGUI.java
index ebf7bde..04db84a 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/MainGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/MainGUI.java
@@ -6,7 +6,7 @@ import me.trouper.sentinel.server.gui.config.ConfigGUI;
import me.trouper.sentinel.server.gui.nbt.NBTGui;
import me.trouper.sentinel.server.gui.whitelist.WhitelistGUI;
import me.trouper.sentinel.utils.PlayerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.entity.Player;
@@ -22,7 +22,7 @@ public class MainGUI {
public static Set awaitingCallback = new HashSet<>();
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Home"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Home"))
.size(27)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
diff --git a/src/main/java/me/trouper/sentinel/server/gui/PaginatedGUI.java b/src/main/java/me/trouper/sentinel/server/gui/PaginatedGUI.java
index e44a406..e3eb201 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/PaginatedGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/PaginatedGUI.java
@@ -3,8 +3,9 @@ package me.trouper.sentinel.server.gui;
import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
@@ -17,7 +18,7 @@ import org.bukkit.inventory.ItemStack;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
-public abstract class PaginatedGUI {
+public abstract class PaginatedGUI implements Main {
protected static final int ITEMS_PER_PAGE = 45;
protected static final Map currentPages = new HashMap<>();
@@ -51,12 +52,10 @@ public abstract class PaginatedGUI {
int page = currentPages.compute(p.getUniqueId(), (k, v) -> realizePage(p, v == null ? 0 : v));
FilterOperator operator = chosenOperator.computeIfAbsent(p.getUniqueId(), v -> FilterOperator.AND);
- // Add persistent bottom items (navigation and filter)
inv.setItem(45, createNavigationItem("Previous", realizePage(p, page - 1)));
inv.setItem(49, createFilterItem(p));
inv.setItem(53, createNavigationItem("Next", realizePage(p, page + 1)));
- // Fill the remaining bottom slots with red stained glass
for (int slot : new int[]{46, 47, 48, 50, 51, 52}) {
inv.setItem(slot, createPlaceholderItem(true));
}
@@ -71,7 +70,6 @@ public abstract class PaginatedGUI {
AtomicInteger remaining = new AtomicInteger(pageSize);
- // Process each entry and update GUI as each item loads
for (int i = 0; i < pageSize; i++) {
T entry = pageEntries.get(i);
ItemStack displayItem = createDisplayItem(entry);
@@ -81,7 +79,6 @@ public abstract class PaginatedGUI {
inv.setItem(slot, displayItem);
if (runAsynchronously) p.playSound(p, Sound.UI_HUD_BUBBLE_POP, SoundCategory.MASTER,1,1.1F);
if (remaining.decrementAndGet() == 0) {
- // Update remaining main slots and bottom slots to lime
for (int bottomSlot : new int[]{46, 47, 48, 50, 51, 52}) {
inv.setItem(bottomSlot, createPlaceholderItem(false));
}
@@ -90,7 +87,6 @@ public abstract class PaginatedGUI {
});
}
- // Handle case where there are no items
if (pageSize == 0) {
Bukkit.getScheduler().runTask(Sentinel.getInstance(), () -> {
for (int bottomSlot : new int[]{46, 47, 48, 50, 51, 52}) {
@@ -101,7 +97,6 @@ public abstract class PaginatedGUI {
}
};
- // Start async loading of items
if (runAsynchronously) Bukkit.getScheduler().runTaskAsynchronously(Sentinel.getInstance(), task);
else task.run();
}
@@ -115,7 +110,7 @@ public abstract class PaginatedGUI {
Set filters = activeFilters.computeIfAbsent(p.getUniqueId(), k -> new HashSet<>());
CustomGui.GuiBuilder filterGui = CustomGui.create()
- .title(Text.color("&6&lFilters"))
+ .title(OldTXT.color("&6&lFilters"))
.size(27)
.defineMain(e -> e.setCancelled(true))
.define(26, Items.BACK, e -> {
@@ -180,8 +175,8 @@ public abstract class PaginatedGUI {
}
return new ItemBuilder()
.material(Material.ARROW)
- .name(Text.color("&b" + direction + "&7 Page"))
- .lore(Text.color("&7 > &b" + pageTo))
+ .name(OldTXT.color("&b" + direction + "&7 Page"))
+ .lore(OldTXT.color("&7 > &b" + pageTo))
.build();
}
@@ -190,7 +185,7 @@ public abstract class PaginatedGUI {
String name = isRed ? "&cComputing Entries..." : "&aAll Entries Loaded.";
return new ItemBuilder()
.material(material)
- .name(Text.color(name))
+ .name(OldTXT.color(name))
.build();
}
@@ -198,15 +193,15 @@ public abstract class PaginatedGUI {
List operatorList = new ArrayList<>();
FilterOperator chosen = chosenOperator.computeIfAbsent(p.getUniqueId(), v -> FilterOperator.AND);
for (FilterOperator value : FilterOperator.values()) {
- if (value.equals(chosen)) operatorList.add(Text.color("&b&n" + value.name()));
- else operatorList.add(Text.color("&b" + value.name()));
+ if (value.equals(chosen)) operatorList.add(OldTXT.color("&b&n" + value.name()));
+ else operatorList.add(OldTXT.color("&b" + value.name()));
}
return new ItemBuilder()
.material(Material.HOPPER)
- .name(Text.color("&6&lFilters"))
- .lore(Text.color("&7Filters Selected: &e" + getFilterCount(p)))
- .lore(Text.color("&7Shift-Click to cycle filter operator."))
- .lore(Text.color("&7Operator: "))
+ .name(OldTXT.color("&6&lFilters"))
+ .lore(OldTXT.color("&7Filters Selected: &e" + getFilterCount(p)))
+ .lore(OldTXT.color("&7Shift-Click to cycle filter operator."))
+ .lore(OldTXT.color("&7Operator: "))
.lore(operatorList)
.build();
}
@@ -228,4 +223,22 @@ public abstract class PaginatedGUI {
};
}
}
+
+ protected ItemStack createFilterToggleItem(String name, Material mat, boolean active) {
+ return new ItemBuilder()
+ .material(mat)
+ .name(OldTXT.color((active ? "&a" : "&c") + name))
+ .lore(OldTXT.color("&7Click to " + (active ? "disable" : "enable")))
+ .build();
+ }
+
+ protected ItemStack createFilterToggleItemValue(String name, Material mat, boolean active, String value) {
+ return new ItemBuilder()
+ .material(mat)
+ .name(OldTXT.color((active ? "&a" : "&c") + name))
+ .lore(OldTXT.color("&7Value&f: &b" + value))
+ .lore(OldTXT.color("&7Left Click to " + (active ? "disable" : "enable")))
+ .lore(OldTXT.color("&7Right Click to set value."))
+ .build();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/AntiNukeGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/AntiNukeGUI.java
index 7925744..d7fc5a6 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/AntiNukeGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/AntiNukeGUI.java
@@ -24,7 +24,7 @@ import me.trouper.sentinel.server.events.violations.whitelist.CommandBlockExecut
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
@@ -33,7 +33,7 @@ import org.bukkit.inventory.ItemStack;
public class AntiNukeGUI {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Choose a check"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Choose a check"))
.size(9*5)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -95,8 +95,8 @@ public class AntiNukeGUI {
private static ItemStack getCheckItem(Material item, String name) {
return ItemBuilder.create()
.material(item)
- .name(Text.color("&b" + name))
- .lore(Text.color("&8&l➥&7 Modify this check"))
+ .name(OldTXT.color("&b" + name))
+ .lore(OldTXT.color("&8&l➥&7 Modify this check"))
.build();
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/ConfigGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/ConfigGUI.java
index adebbd4..361e55e 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/ConfigGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/ConfigGUI.java
@@ -4,7 +4,7 @@ import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.chat.ChatGUI;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.entity.Player;
@@ -13,7 +13,7 @@ import org.bukkit.inventory.Inventory;
public class ConfigGUI {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Config Home"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Config Home"))
.size(27)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/chat/ChatGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/chat/ChatGUI.java
index 0ccf174..cc65af1 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/chat/ChatGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/chat/ChatGUI.java
@@ -5,7 +5,7 @@ import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.config.ConfigGUI;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
@@ -16,7 +16,7 @@ import org.bukkit.inventory.ItemStack;
public class ChatGUI {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Edit a Filter"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Edit a Filter"))
.size(27)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -55,25 +55,25 @@ public class ChatGUI {
private static final ItemStack PROFANITY_FILTER = ItemBuilder.create()
.material(Material.COAL)
- .name(Text.color("&bProfanity Filter"))
- .lore(Text.color("&8&l➥&7 Edit Score Settings"))
+ .name(OldTXT.color("&bProfanity Filter"))
+ .lore(OldTXT.color("&8&l➥&7 Edit Score Settings"))
.build();
private static final ItemStack SPAM_FILTER = ItemBuilder.create()
.material(Material.PORKCHOP)
- .name(Text.color("&bSpam Filter"))
- .lore(Text.color("&8&l➥&7 Edit Heat Settings"))
+ .name(OldTXT.color("&bSpam Filter"))
+ .lore(OldTXT.color("&8&l➥&7 Edit Heat Settings"))
.build();
private static final ItemStack UNICODE_FILTER = ItemBuilder.create()
.material(Material.PAPER)
- .name(Text.color("&bUnicode Filter"))
- .lore(Text.color("&8&l➥&7 Edit regex"))
+ .name(OldTXT.color("&bUnicode Filter"))
+ .lore(OldTXT.color("&8&l➥&7 Edit regex"))
.build();
private static final ItemStack URL_FILTER = ItemBuilder.create()
.material(Material.CHAIN)
- .name(Text.color("&bURL Filter"))
- .lore(Text.color("&8&l➥&7 Edit regex"))
+ .name(OldTXT.color("&bURL Filter"))
+ .lore(OldTXT.color("&8&l➥&7 Edit regex"))
.build();
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.java
index d3c8e8a..672df82 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/chat/ProfanityFilterGUI.java
@@ -4,12 +4,12 @@ import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.MainConfig;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -21,9 +21,9 @@ import org.bukkit.inventory.ItemStack;
import java.util.function.BiConsumer;
-public class ProfanityFilterGUI {
+public class ProfanityFilterGUI implements Main {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Editing Profanity Filter"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Editing Profanity Filter"))
.size(54)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -42,7 +42,7 @@ public class ProfanityFilterGUI {
}
ServerUtils.verbose("ProfanityFilterGUI#blankPage Page now blank");
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.enabled) {
+ if (main.dir().io.mainConfig.chat.profanityFilter.enabled) {
top = Items.GREEN;
}
@@ -52,18 +52,18 @@ public class ProfanityFilterGUI {
ServerUtils.verbose("ProfanityFilterGUI#blankPage Adding GUI Items");
inv.setItem(53,Items.BACK);
- inv.setItem(3,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.enabled, Items.configItem("Profanity Filter Toggle",Material.CLOCK,"Enable or Disable the whole Profanity filter")));
- inv.setItem(5,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
- inv.setItem(10,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.lowScore, Items.configItem("Low Score Gain", Material.WHITE_WOOL, "How much score will be added if the player \ndid not attempt to bypass the filter.")));
- inv.setItem(19,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumLowScore, Items.configItem("Medium-Low Score Gain", Material.LIME_WOOL, "How much score will be added if the player \nused l33t speak to attempt a bypass")));
- inv.setItem(28,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumScore, Items.configItem("Medium Score Gain", Material.YELLOW_WOOL, "How much score will be added if the player \nused sp/ecia|l characters to attempt a bypass")));
- inv.setItem(37,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumHighScore, Items.configItem("Medium-High Score Gain", Material.ORANGE_WOOL, "How much score will be added if the player \nused reeeeeeepeating letters to attempt a bypass")));
- inv.setItem(46,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.highScore, Items.configItem("High Score Gain", Material.RED_WOOL, "How much score will be added if the player \nused pun. ctua, tion or spaces to attempt a bypass")));
- inv.setItem(29,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.regexScore, Items.configItem("Regex Score Gain", Material.DISPENSER, "How much score will be added if the player \nmatched the regex setting throughout \nthe processing of the message")));
- inv.setItem(22,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.punishScore, Items.configItem("Punish Score", Material.IRON_BARS, "If the player's score is above this \nthe punishment commands will be ran.")));
- inv.setItem(33,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.scoreDecay, Items.configItem("Score Decay", Material.DEAD_BUBBLE_CORAL_BLOCK, "How much score players will loose each minute.")));
- inv.setItem(31,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.profanityPunishCommands,Material.WOODEN_AXE, "Default Punishment Commands", "%player% will be replaced with the offender's name"));
- inv.setItem(40,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.strictPunishCommands,Material.DIAMOND_AXE, "Strict Punishment Commands", "If words from the strict words list are flagged, \nthis list will be ran instead \n%player% will be replaced with the offender's name"));
+ inv.setItem(3,Items.booleanItem(main.dir().io.mainConfig.chat.profanityFilter.enabled, Items.configItem("Profanity Filter Toggle",Material.CLOCK,"Enable or Disable the whole Profanity filter")));
+ inv.setItem(5,Items.booleanItem(main.dir().io.mainConfig.chat.profanityFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
+ inv.setItem(10,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.lowScore, Items.configItem("Low Score Gain", Material.WHITE_WOOL, "How much score will be added if the player \ndid not attempt to bypass the filter.")));
+ inv.setItem(19,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.mediumLowScore, Items.configItem("Medium-Low Score Gain", Material.LIME_WOOL, "How much score will be added if the player \nused l33t speak to attempt a bypass")));
+ inv.setItem(28,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.mediumScore, Items.configItem("Medium Score Gain", Material.YELLOW_WOOL, "How much score will be added if the player \nused sp/ecia|l characters to attempt a bypass")));
+ inv.setItem(37,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.mediumHighScore, Items.configItem("Medium-High Score Gain", Material.ORANGE_WOOL, "How much score will be added if the player \nused reeeeeeepeating letters to attempt a bypass")));
+ inv.setItem(46,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.highScore, Items.configItem("High Score Gain", Material.RED_WOOL, "How much score will be added if the player \nused pun. ctua, tion or spaces to attempt a bypass")));
+ inv.setItem(29,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.regexScore, Items.configItem("Regex Score Gain", Material.DISPENSER, "How much score will be added if the player \nmatched the regex setting throughout \nthe processing of the message")));
+ inv.setItem(22,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.punishScore, Items.configItem("Punish Score", Material.IRON_BARS, "If the player's score is above this \nthe punishment commands will be ran.")));
+ inv.setItem(33,Items.intItem(main.dir().io.mainConfig.chat.profanityFilter.scoreDecay, Items.configItem("Score Decay", Material.DEAD_BUBBLE_CORAL_BLOCK, "How much score players will loose each minute.")));
+ inv.setItem(31,Items.stringListItem(main.dir().io.mainConfig.chat.profanityFilter.profanityPunishCommands,Material.WOODEN_AXE, "Default Punishment Commands", "%player% will be replaced with the offender's name"));
+ inv.setItem(40,Items.stringListItem(main.dir().io.mainConfig.chat.profanityFilter.strictPunishCommands,Material.DIAMOND_AXE, "Strict Punishment Commands", "If words from the strict words list are flagged, \nthis list will be ran instead \n%player% will be replaced with the offender's name"));
} catch (Exception e) {
e.printStackTrace();
}
@@ -74,35 +74,35 @@ public class ProfanityFilterGUI {
if (!MainGUI.verify((Player) e.getWhoClicked())) return;
switch (e.getSlot()) {
case 3 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.enabled = !Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.enabled;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.profanityFilter.enabled = !main.dir().io.mainConfig.chat.profanityFilter.enabled;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 5 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.silent = !Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.silent;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.profanityFilter.silent = !main.dir().io.mainConfig.chat.profanityFilter.silent;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
- case 10 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.lowScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.lowScore);
- case 19 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumLowScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumLowScore);
- case 28 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumScore);
- case 37 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumHighScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.mediumHighScore);
- case 46 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.highScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.highScore);
- case 29 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.regexScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.regexScore);
- case 22 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.punishScore = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.punishScore);
- case 33 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.scoreDecay = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.scoreDecay);
+ case 10 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.lowScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.lowScore);
+ case 19 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumLowScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.mediumLowScore);
+ case 28 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.mediumScore);
+ case 37 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.mediumHighScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.mediumHighScore);
+ case 46 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.highScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.highScore);
+ case 29 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.regexScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.regexScore);
+ case 22 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.punishScore = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.punishScore);
+ case 33 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.profanityFilter.scoreDecay = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.profanityFilter.scoreDecay);
case 31 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.profanityFilter.profanityPunishCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.profanityPunishCommands);
+ },"" + main.dir().io.mainConfig.chat.profanityFilter.profanityPunishCommands);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.profanityPunishCommands.clear();
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.profanityFilter.profanityPunishCommands.clear();
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
@@ -110,17 +110,17 @@ public class ProfanityFilterGUI {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.profanityFilter.strictPunishCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.strictPunishCommands);
+ },"" + main.dir().io.mainConfig.chat.profanityFilter.strictPunishCommands);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.profanityFilter.strictPunishCommands.clear();
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.profanityFilter.strictPunishCommands.clear();
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
}
}
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.mainConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.mainConfig);
private void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
@@ -131,9 +131,9 @@ public class ProfanityFilterGUI {
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
cfg.save();
- player.sendMessage(Text.prefix("Value updated successfully"));
+ successAny(player,"Value updated successfully");
player.openInventory(home.getInventory());
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.java
index 30ef5f4..da8ce0a 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/chat/SpamFilterGUI.java
@@ -4,11 +4,11 @@ import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.MainConfig;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -20,10 +20,10 @@ import org.bukkit.inventory.ItemStack;
import java.util.function.BiConsumer;
-public class SpamFilterGUI {
+public class SpamFilterGUI implements Main {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Editing Spam Filter"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Editing Spam Filter"))
.size(54)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -31,16 +31,14 @@ public class SpamFilterGUI {
e.getWhoClicked().openInventory(new ChatGUI().home.getInventory());
})
.build();
-
-
-
+
private void blankPage(Inventory inv) {
for (int i = 0; i < inv.getSize(); i++) {
inv.setItem(i,Items.BLANK);
}
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.enabled) {
+ if (main.dir().io.mainConfig.chat.spamFilter.enabled) {
top = Items.GREEN;
}
@@ -49,18 +47,18 @@ public class SpamFilterGUI {
}
inv.setItem(53,Items.BACK);
- inv.setItem(3,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.enabled, Items.configItem("Spam Filter Toggle", Material.CLOCK, "Enable or disable the whole Spam Filter")));
- inv.setItem(5,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.silent, Items.configItem("Silent Toggle", Material.FEATHER, "Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
- inv.setItem(10,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.defaultGain, Items.configItem("Default Heat Gain", Material.BUCKET, "How much heat will be added to each message.")));
- inv.setItem(19,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.lowGain, Items.configItem("Low Heat Gain", Material.WATER_BUCKET, "Extra heat to be added if the \nmessage is greater than 25% similar \nto their previous message.")));
- inv.setItem(28,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.mediumGain, Items.configItem("Medium Heat Gain", Material.COD_BUCKET, "Extra heat to be added if the \nmessage is greater than 50% similar \nto their previous message.")));
- inv.setItem(37,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.highGain, Items.configItem("High Heat Gain", Material.PUFFERFISH_BUCKET, "Extra heat to be added if the \nmessage is greater than 90% similar \nto their previous message.")));
- inv.setItem(46,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockHeat, Items.configItem("Block Heat", Material.BARRIER, "If the player's heat is above this \nthen their message will be blocked and \nflagged as spam.")));
- inv.setItem(21,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity, Items.configItem("Block Similarity", Material.BARRIER, "If the message's similarity is above \nthis, it will get automatically blocked \nand flagged as spam.")));
- inv.setItem(23,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishHeat, Items.configItem("Punish Heat", Material.IRON_BARS, "If the player's heat is above this \nthe punishment commands will be ran.")));
- inv.setItem(25,Items.intItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.heatDecay, Items.configItem("Heat Decay", Material.DEAD_BUBBLE_CORAL_BLOCK, "How much heat players will loose each second.")));
- inv.setItem(32,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishCommands,Material.DIAMOND_AXE, "Punishment Commands", "%player% will be replaced with the offender's name"));
- inv.setItem(34,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.whitelist,Material.PAPER, "Message Whitelist", "Messages which will be ignored by the spam filter"));
+ inv.setItem(3,Items.booleanItem(main.dir().io.mainConfig.chat.spamFilter.enabled, Items.configItem("Spam Filter Toggle", Material.CLOCK, "Enable or disable the whole Spam Filter")));
+ inv.setItem(5,Items.booleanItem(main.dir().io.mainConfig.chat.spamFilter.silent, Items.configItem("Silent Toggle", Material.FEATHER, "Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
+ inv.setItem(10,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.defaultGain, Items.configItem("Default Heat Gain", Material.BUCKET, "How much heat will be added to each message.")));
+ inv.setItem(19,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.lowGain, Items.configItem("Low Heat Gain", Material.WATER_BUCKET, "Extra heat to be added if the \nmessage is greater than 25% similar \nto their previous message.")));
+ inv.setItem(28,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.mediumGain, Items.configItem("Medium Heat Gain", Material.COD_BUCKET, "Extra heat to be added if the \nmessage is greater than 50% similar \nto their previous message.")));
+ inv.setItem(37,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.highGain, Items.configItem("High Heat Gain", Material.PUFFERFISH_BUCKET, "Extra heat to be added if the \nmessage is greater than 90% similar \nto their previous message.")));
+ inv.setItem(46,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.blockHeat, Items.configItem("Block Heat", Material.BARRIER, "If the player's heat is above this \nthen their message will be blocked and \nflagged as spam.")));
+ inv.setItem(21,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.blockSimilarity, Items.configItem("Block Similarity", Material.BARRIER, "If the message's similarity is above \nthis, it will get automatically blocked \nand flagged as spam.")));
+ inv.setItem(23,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.punishHeat, Items.configItem("Punish Heat", Material.IRON_BARS, "If the player's heat is above this \nthe punishment commands will be ran.")));
+ inv.setItem(25,Items.intItem(main.dir().io.mainConfig.chat.spamFilter.heatDecay, Items.configItem("Heat Decay", Material.DEAD_BUBBLE_CORAL_BLOCK, "How much heat players will loose each second.")));
+ inv.setItem(32,Items.stringListItem(main.dir().io.mainConfig.chat.spamFilter.punishCommands,Material.DIAMOND_AXE, "Punishment Commands", "%player% will be replaced with the offender's name"));
+ inv.setItem(34,Items.stringListItem(main.dir().io.mainConfig.chat.spamFilter.whitelist,Material.PAPER, "Message Whitelist", "Messages which will be ignored by the spam filter"));
}
private void mainClick(InventoryClickEvent e) {
@@ -70,40 +68,40 @@ public class SpamFilterGUI {
switch (e.getSlot()) {
case 3 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.enabled = !Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.enabled;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.spamFilter.enabled = !main.dir().io.mainConfig.chat.spamFilter.enabled;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 5 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.silent = !Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.silent;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.spamFilter.silent = !main.dir().io.mainConfig.chat.spamFilter.silent;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
- case 10 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.defaultGain = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.defaultGain);
- case 19 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.lowGain = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.lowGain);
- case 28 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.mediumGain = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.mediumGain);
- case 37 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.highGain = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.highGain);
- case 46 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.blockHeat = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockHeat);
- case 21 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.blockSimilarity = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.blockSimilarity);
- case 23 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.punishHeat = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishHeat);
- case 25 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.heatDecay = args.getAll().toInt(),"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.heatDecay);
+ case 10 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.defaultGain = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.defaultGain);
+ case 19 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.lowGain = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.lowGain);
+ case 28 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.mediumGain = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.mediumGain);
+ case 37 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.highGain = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.highGain);
+ case 46 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.blockHeat = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.blockHeat);
+ case 21 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.blockSimilarity = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.blockSimilarity);
+ case 23 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.punishHeat = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.punishHeat);
+ case 25 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.spamFilter.heatDecay = args.getAll().toInt(),"" + main.dir().io.mainConfig.chat.spamFilter.heatDecay);
case 32 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.spamFilter.punishCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishCommands);
+ },"" + main.dir().io.mainConfig.chat.spamFilter.punishCommands);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.spamFilter.punishCommands.clear();
+ main.dir().io.mainConfig.chat.spamFilter.punishCommands.clear();
blankPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.save();
}
}
}
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.mainConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.mainConfig);
private void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
@@ -114,9 +112,9 @@ public class SpamFilterGUI {
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
cfg.save();
- player.sendMessage(Text.prefix("Value updated successfully"));
+ messageAny(player,"Value updated successfully");
player.openInventory(home.getInventory());
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/chat/UnicodeFilterGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/chat/UnicodeFilterGUI.java
index 601d0b9..6f161b6 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/chat/UnicodeFilterGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/chat/UnicodeFilterGUI.java
@@ -4,12 +4,12 @@ import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.MainConfig;
+import me.trouper.sentinel.server.Main;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -21,10 +21,10 @@ import org.bukkit.inventory.ItemStack;
import java.util.function.BiConsumer;
-public class UnicodeFilterGUI {
+public class UnicodeFilterGUI implements Main {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Editing Unicode Filter"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Editing Unicode Filter"))
.size(36)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -40,7 +40,7 @@ public class UnicodeFilterGUI {
}
ServerUtils.verbose("Unicode Filter GUI blank!");
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.enabled) {
+ if (main.dir().io.mainConfig.chat.unicodeFilter.enabled) {
top = Items.GREEN;
}
@@ -48,11 +48,11 @@ public class UnicodeFilterGUI {
inv.setItem(i,top);
}
- inv.setItem(3,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.enabled, Items.configItem("Unicode Filter Toggle", Material.CLOCK,"Enable or Disable the whole Unicode filter")));
- inv.setItem(5,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
- inv.setItem(20,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punished,Items.configItem("Punished",Material.IRON_BARS,"Toggles execution of punishment commands.")));
- inv.setItem(22,Items.stringItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.regex,Items.configItem("Allowed Char Regex",Material.DISPENSER,"Toggles execution of punishment commands.")));
- inv.setItem(24,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punishCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands which will be executed if punishment is enabled."));
+ inv.setItem(3,Items.booleanItem(main.dir().io.mainConfig.chat.unicodeFilter.enabled, Items.configItem("Unicode Filter Toggle", Material.CLOCK,"Enable or Disable the whole Unicode filter")));
+ inv.setItem(5,Items.booleanItem(main.dir().io.mainConfig.chat.unicodeFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
+ inv.setItem(20,Items.booleanItem(main.dir().io.mainConfig.chat.unicodeFilter.punished,Items.configItem("Punished",Material.IRON_BARS,"Toggles execution of punishment commands.")));
+ inv.setItem(22,Items.stringItem(main.dir().io.mainConfig.chat.unicodeFilter.regex,Items.configItem("Allowed Char Regex",Material.DISPENSER,"Toggles execution of punishment commands.")));
+ inv.setItem(24,Items.stringListItem(main.dir().io.mainConfig.chat.unicodeFilter.punishCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands which will be executed if punishment is enabled."));
}
@@ -62,41 +62,41 @@ public class UnicodeFilterGUI {
switch (e.getSlot()) {
case 3 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.enabled = !Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.enabled;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.unicodeFilter.enabled = !main.dir().io.mainConfig.chat.unicodeFilter.enabled;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 5 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.silent = !Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.silent;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.unicodeFilter.silent = !main.dir().io.mainConfig.chat.unicodeFilter.silent;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 20 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punished = !Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punished;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.unicodeFilter.punished = !main.dir().io.mainConfig.chat.unicodeFilter.punished;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
- case 22 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.unicodeFilter.regex = args.getAll().toString(),Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.regex);
+ case 22 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.unicodeFilter.regex = args.getAll().toString(),main.dir().io.mainConfig.chat.unicodeFilter.regex);
case 24 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.unicodeFilter.punishCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punishCommands);
+ },"" + main.dir().io.mainConfig.chat.unicodeFilter.punishCommands);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.unicodeFilter.punishCommands.clear();
+ main.dir().io.mainConfig.chat.unicodeFilter.punishCommands.clear();
blankPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.save();
}
}
}
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.mainConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.mainConfig);
private void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
@@ -107,9 +107,9 @@ public class UnicodeFilterGUI {
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
cfg.save();
- player.sendMessage(Text.prefix("Value updated successfully"));
+ messageAny(player,"Value updated successfully");
player.openInventory(home.getInventory());
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/config/chat/UrlFilterGUI.java b/src/main/java/me/trouper/sentinel/server/gui/config/chat/UrlFilterGUI.java
index ec00b9b..cf32f6e 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/config/chat/UrlFilterGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/config/chat/UrlFilterGUI.java
@@ -1,15 +1,14 @@
package me.trouper.sentinel.server.gui.config.chat;
import io.github.itzispyder.pdk.commands.Args;
-import io.github.itzispyder.pdk.events.CustomListener;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.MainConfig;
+import me.trouper.sentinel.server.events.QuickListener;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -21,9 +20,9 @@ import org.bukkit.inventory.ItemStack;
import java.util.function.BiConsumer;
-public class UrlFilterGUI implements CustomListener {
+public class UrlFilterGUI implements QuickListener {
public final CustomGui home = CustomGui.create()
- .title(Text.color("&6&lSentinel &8»&0 Editing Unicode Filter"))
+ .title(OldTXT.color("&6&lSentinel &8»&0 Editing Unicode Filter"))
.size(36)
.onDefine(this::blankPage)
.defineMain(this::mainClick)
@@ -39,7 +38,7 @@ public class UrlFilterGUI implements CustomListener {
}
ItemStack top = Items.RED;
- if (Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.enabled) {
+ if (main.dir().io.mainConfig.chat.urlFilter.enabled) {
top = Items.GREEN;
}
@@ -47,12 +46,12 @@ public class UrlFilterGUI implements CustomListener {
inv.setItem(i,top);
}
- inv.setItem(3,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.enabled, Items.configItem("Unicode Filter Toggle", Material.CLOCK,"Enable or Disable the whole Unicode filter")));
- inv.setItem(5,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
- inv.setItem(19,Items.booleanItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punished,Items.configItem("Punished",Material.IRON_BARS,"Toggles execution of punishment commands.")));
- inv.setItem(21,Items.stringItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.regex,Items.configItem("Allowed Char Regex",Material.DISPENSER,"Toggles execution of punishment commands.")));
- inv.setItem(23,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punishCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands which will be executed if punishment is enabled."));
- inv.setItem(25,Items.stringListItem(Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.whitelist,Material.PAPER,"Whitelist","URLs which will not flag the filter."));
+ inv.setItem(3,Items.booleanItem(main.dir().io.mainConfig.chat.urlFilter.enabled, Items.configItem("Unicode Filter Toggle", Material.CLOCK,"Enable or Disable the whole Unicode filter")));
+ inv.setItem(5,Items.booleanItem(main.dir().io.mainConfig.chat.urlFilter.silent, Items.configItem("Silent Mode",Material.FEATHER,"Whether to notify players that their messages \nwere blocked. Enabling could help deter bypassing.")));
+ inv.setItem(19,Items.booleanItem(main.dir().io.mainConfig.chat.urlFilter.punished,Items.configItem("Punished",Material.IRON_BARS,"Toggles execution of punishment commands.")));
+ inv.setItem(21,Items.stringItem(main.dir().io.mainConfig.chat.urlFilter.regex,Items.configItem("Allowed Char Regex",Material.DISPENSER,"Toggles execution of punishment commands.")));
+ inv.setItem(23,Items.stringListItem(main.dir().io.mainConfig.chat.urlFilter.punishCommands,Material.DIAMOND_AXE,"Punishment Commands","Commands which will be executed if punishment is enabled."));
+ inv.setItem(25,Items.stringListItem(main.dir().io.mainConfig.chat.urlFilter.whitelist,Material.PAPER,"Whitelist","URLs which will not flag the filter."));
}
@@ -62,53 +61,53 @@ public class UrlFilterGUI implements CustomListener {
switch (e.getSlot()) {
case 3 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.enabled = !Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.enabled;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.urlFilter.enabled = !main.dir().io.mainConfig.chat.urlFilter.enabled;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 5 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.silent = !Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.silent;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.urlFilter.silent = !main.dir().io.mainConfig.chat.urlFilter.silent;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
case 19 -> {
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punished = !Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punished;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.chat.urlFilter.punished = !main.dir().io.mainConfig.chat.urlFilter.punished;
+ main.dir().io.mainConfig.save();
blankPage(e.getInventory());
}
- case 21 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.urlFilter.regex = args.getAll().toString(),Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.regex);
+ case 21 -> queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> cfg.chat.urlFilter.regex = args.getAll().toString(),main.dir().io.mainConfig.chat.urlFilter.regex);
case 23 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.urlFilter.punishCommands.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punishCommands);
+ },"" + main.dir().io.mainConfig.chat.urlFilter.punishCommands);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.punishCommands.clear();
+ main.dir().io.mainConfig.chat.urlFilter.punishCommands.clear();
blankPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.save();
}
case 25 -> {
if (e.isLeftClick()) {
queuePlayer((Player) e.getWhoClicked(), (cfg,args) -> {
cfg.chat.urlFilter.whitelist.add(args.getAll().toString());
- },"" + Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.whitelist);
+ },"" + main.dir().io.mainConfig.chat.urlFilter.whitelist);
return;
}
- Sentinel.getInstance().getDirector().io.mainConfig.chat.urlFilter.whitelist.clear();
+ main.dir().io.mainConfig.chat.urlFilter.whitelist.clear();
blankPage(e.getInventory());
- Sentinel.getInstance().getDirector().io.mainConfig.save();
+ main.dir().io.mainConfig.save();
}
}
}
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.mainConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.mainConfig);
private void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
@@ -119,9 +118,9 @@ public class UrlFilterGUI implements CustomListener {
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
cfg.save();
- player.sendMessage(Text.prefix("Value updated successfully"));
+ successAny(player,"Value updated successfully");
player.openInventory(home.getInventory());
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/nbt/NBTGui.java b/src/main/java/me/trouper/sentinel/server/gui/nbt/NBTGui.java
index 7ea8f3b..47467b1 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/nbt/NBTGui.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/nbt/NBTGui.java
@@ -1,30 +1,36 @@
package me.trouper.sentinel.server.gui.nbt;
-import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
+import io.github.itzispyder.pdk.commands.Args;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
+import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
+import io.papermc.paper.event.player.AsyncChatEvent;
import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.data.config.ViolationConfig;
import me.trouper.sentinel.data.storage.NBTStorage;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.PaginatedGUI;
-import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.*;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
-import org.bukkit.Bukkit;
-import org.bukkit.Material;
-import org.bukkit.Sound;
+import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import java.util.*;
+import java.util.function.BiConsumer;
import java.util.stream.Collectors;
-public class NBTGui
- extends PaginatedGUI> {
+public class NBTGui extends PaginatedGUI> {
+
private final NBTStorage nbtStorage;
+ private static final Map chosenPlayer = new HashMap<>();
public NBTGui() {
- this.nbtStorage = Sentinel.getInstance().getDirector().io.nbtStorage;
+ this.nbtStorage = main.dir().io.nbtStorage;
}
@Override
@@ -39,16 +45,16 @@ public class NBTGui
@Override
protected String getTitle(Player p) {
- return Text.color("&6&lCaught NBT &7(%s/%s filtered)".formatted(this.getFilteredCount(p), Sentinel.getInstance().getDirector().io.nbtStorage.caughtItems.size()));
+ return FormatUtils.legacyColor("&6&lCaught NBT &7(%s/%s filtered)".formatted(this.getFilteredCount(p), main.dir().io.nbtStorage.caughtItems.size()));
}
@Override
protected void handleMainClick(Player p, InventoryClickEvent e) {
e.setCancelled(true);
MainGUI.verify(p);
- Map.Entry entry;
+ Map.Entry entry;
ItemStack item;
- List> filtered;
+ List> filtered;
int slot = e.getSlot();
if (slot >= 45) {
return;
@@ -64,60 +70,101 @@ public class NBTGui
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
} else if (e.isRightClick() && this.nbtStorage.deleteItem(entry.getKey())) {
p.playSound(p.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 1.0f, 2.0f);
- e.getClickedInventory().setItem(slot, ItemBuilder.create()
- .material(Material.STRUCTURE_VOID)
- .name(Text.color("&cDeleted Item"))
- .lore(Text.color("&7You have deleted this item."))
- .lore(Text.color("&7This will disappear next refresh."))
+ e.getClickedInventory().setItem(slot, ItemBuilder.of(Material.BARRIER)
+ .displayName(Component.text("Deleted Item", NamedTextColor.RED))
+ .loreComponent(
+ Component.text("You have deleted this item.",NamedTextColor.GRAY),
+ Component.text("This will disappear next refresh.",NamedTextColor.GRAY)
+ )
.build());
}
}
}
@Override
- protected ItemStack createDisplayItem(Map.Entry entry) {
+ protected ItemStack createDisplayItem(Map.Entry entry) {
ItemStack item = NBTStorage.getItem(entry.getKey());
if (item == null) {
return null;
}
- ArrayList lore = new ArrayList<>();
- lore.add(Text.color("&7NBT Name: " + LegacyComponentSerializer.legacyAmpersand().serialize(item.effectiveName())));
- lore.add("");
- lore.add(Text.color("&7Owner: " + Bukkit.getOfflinePlayer(UUID.fromString(entry.getValue())).getName()));
- lore.add("");
- lore.add(Text.color("&eLeft-Click to give item"));
- lore.add(Text.color("&eRight-Click to delete item"));
- return new ItemBuilder().material(item.getType()).name(Text.color("&b" + item.getType().name())).lore(lore).build();
+
+ String name = LegacyComponentSerializer.legacySection().serialize(item.effectiveName());
+ Component owner = Component.text(Bukkit.getOfflinePlayer(entry.getValue().owner).getName(), NamedTextColor.WHITE);
+
+ if (name.length() >= 64) {
+ name = name.substring(0,64) + "...";
+ }
+
+ return ItemBuilder.of(item.getType())
+ .displayName(Component.text(FormatUtils.formatEnum(item.getType()),NamedTextColor.GOLD).decoration(TextDecoration.ITALIC,false))
+ .loreComponent(
+ Component.text("NBT Name: ",NamedTextColor.GRAY).append(Text.color(name)),
+ Component.text("Size: ",NamedTextColor.GRAY).append(Component.text(FormatUtils.formatBytes(entry.getValue().byteSize),NamedTextColor.WHITE)),
+ Component.empty(),
+ Component.text("Owner: ",NamedTextColor.GRAY).append(owner),
+ Component.empty(),
+ Component.text("Left-Click to give item",NamedTextColor.YELLOW),
+ Component.text("Right-Click to delete item",NamedTextColor.YELLOW)
+ )
+ .build();
}
@Override
protected void addFilterItems(CustomGui.GuiBuilder filterGui, Player p, Set filters) {
+ filterGui.define(0, createFilterToggleItem("Your NBT", Material.PLAYER_HEAD, filters.contains("OWNER")), e -> toggleFilter(p, "OWNER"));
+ filterGui.define(1, createFilterToggleItem("Other Owners", Material.SPYGLASS, filters.contains("OTHER_OWNERS")), e -> toggleFilter(p, "OTHER_OWNERS"));
+ filterGui.define(2, createFilterToggleItemValue("Specific Player",Material.BOW,filters.contains("USER"),chosenPlayer.getOrDefault(p.getUniqueId(),"null")),
+ e -> {
+ if (e.isLeftClick()) toggleFilter(p, "USER");
+ else if (e.isRightClick()) {
+ queuePlayer(p,(cfg,value)->{
+ String s = value.getAll().toString();
+ ServerUtils.verbose("Callback Received: %s", s);
+ OfflinePlayer target = Bukkit.getOfflinePlayer(s);
+ chosenPlayer.put(p.getUniqueId(),target.getUniqueId().toString());
+ },chosenPlayer.getOrDefault(p.getUniqueId(),"null"));
+ }
+ });
+ }
+
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.violationConfig);
+ protected void queuePlayer(Player player, BiConsumer action, String currentValue) {
+ MainGUI.awaitingCallback.add(player.getUniqueId());
+ player.closeInventory();
+ updater.queuePlayer(player, 20*60, (e)->{
+ e.setCancelled(true);
+ return LegacyComponentSerializer.legacySection().serialize(e.message());
+ }, (cfg, newValue) -> {
+ action.accept(cfg,new Args(newValue.split("\\s+")));
+ messageAny(player,"Value updated successfully");
+ openFilterMenu(player);
+ });
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
@Override
- protected List> filterEntries(Player p, PaginatedGUI.FilterOperator operator) {
- Set filters = activeFilters.computeIfAbsent(p.getUniqueId(), k -> new HashSet());
+ protected List> filterEntries(Player p, FilterOperator operator) {
+ Set filters = activeFilters.computeIfAbsent(p.getUniqueId(), k -> new HashSet<>());
ServerUtils.verbose("Filtering entries for %s. Current: ", p, filters.toString());
return this.nbtStorage.caughtItems.entrySet().stream().filter(entry -> {
if (filters.isEmpty()) {
return true;
}
boolean result = operator == PaginatedGUI.FilterOperator.AND;
- Iterator iterator = filters.iterator();
- while (iterator.hasNext()) {
- String filter;
- boolean conditionMet = switch (filter = (String)iterator.next()) {
- case "OWNER" -> (entry.getValue()).equals(p.getUniqueId().toString());
+ for (String filter : filters) {
+ boolean conditionMet = switch (filter) {
+ case "OWNER" -> entry.getValue().owner.equals(p.getUniqueId());
+ case "OTHER_OWNERS" -> !entry.getValue().owner.equals(p.getUniqueId());
+ case "USER" -> entry.getValue().owner.toString().equals(chosenPlayer.get(p.getUniqueId()));
default -> false;
};
result = operator.apply(result, conditionMet);
- if (operator == PaginatedGUI.FilterOperator.AND && !result) {
- return false;
- }
- if (operator != PaginatedGUI.FilterOperator.OR || !result) continue;
- return true;
+ if (operator == FilterOperator.AND && !result) return false;
+ if (operator == FilterOperator.OR && result) return true;
}
return result;
}).collect(Collectors.toList());
}
+
+
}
diff --git a/src/main/java/me/trouper/sentinel/server/gui/whitelist/WhitelistGUI.java b/src/main/java/me/trouper/sentinel/server/gui/whitelist/WhitelistGUI.java
index 06750b0..53434f4 100644
--- a/src/main/java/me/trouper/sentinel/server/gui/whitelist/WhitelistGUI.java
+++ b/src/main/java/me/trouper/sentinel/server/gui/whitelist/WhitelistGUI.java
@@ -5,14 +5,13 @@ import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
import io.github.itzispyder.pdk.plugin.gui.CustomGui;
import io.github.itzispyder.pdk.utils.misc.config.ConfigUpdater;
import io.papermc.paper.event.player.AsyncChatEvent;
-import me.trouper.sentinel.Sentinel;
import me.trouper.sentinel.data.config.ViolationConfig;
-import me.trouper.sentinel.data.misc.CommandBlockHolder;
+import me.trouper.sentinel.data.types.CommandBlockHolder;
import me.trouper.sentinel.server.gui.Items;
import me.trouper.sentinel.server.gui.MainGUI;
import me.trouper.sentinel.server.gui.PaginatedGUI;
import me.trouper.sentinel.utils.ServerUtils;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.utils.OldTXT;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -39,7 +38,7 @@ public class WhitelistGUI extends PaginatedGUI {
@Override
protected String getTitle(Player p) {
- return Text.color("&6&lCommand Blocks &7(%s/%s filtered)".formatted(getFilteredCount(p),Sentinel.getInstance().getDirector().io.whitelistStorage.holders.size()));
+ return OldTXT.color("&6&lCommand Blocks &7(%s/%s filtered)".formatted(getFilteredCount(p),main.dir().io.whitelistStorage.holders.size()));
}
@Override
@@ -67,20 +66,20 @@ public class WhitelistGUI extends PaginatedGUI {
String.format("X: %d, Y: %d, Z: %d",
(int) holder.loc().x(),
(int) holder.loc().y(),
- (int) holder.loc().z());
+ (int) holder.loc().z());
List lore = new ArrayList<>();
- lore.add(Text.color("&7Owner: " + Bukkit.getOfflinePlayer(holder.owner()).getName()));
- lore.add(Text.color("&7Command: &f" + holder.command()));
- lore.add(Text.color("&7Type: &f" + holder.type()));
- lore.add(Text.color("&7Whitelisted: " + (holder.isWhitelisted() ? "&aYes" : "&cNo")));
- lore.add(Text.color("&7Present: " + (holder.present() ? "&aYes" : "&cNo")));
+ lore.add(OldTXT.color("&7Owner: " + Bukkit.getOfflinePlayer(holder.owner()).getName()));
+ lore.add(OldTXT.color("&7Command: &f" + holder.command()));
+ lore.add(OldTXT.color("&7Type: &f" + holder.type()));
+ lore.add(OldTXT.color("&7Whitelisted: " + (holder.isWhitelisted() ? "&aYes" : "&cNo")));
+ lore.add(OldTXT.color("&7Present: " + (holder.present() ? "&aYes" : "&cNo")));
lore.add("");
- lore.add(Text.color("&eClick to manage!"));
+ lore.add(OldTXT.color("&eClick to manage!"));
return new ItemBuilder()
.material(type)
- .name(Text.color("&b" + name))
+ .name(OldTXT.color("&b" + name))
.lore(lore)
.build();
}
@@ -108,7 +107,7 @@ public class WhitelistGUI extends PaginatedGUI {
});
}
- public static ConfigUpdater updater = new ConfigUpdater<>(Sentinel.getInstance().getDirector().io.violationConfig);
+ public static ConfigUpdater updater = new ConfigUpdater<>(main.dir().io.violationConfig);
protected void queuePlayer(Player player, BiConsumer action, String currentValue) {
MainGUI.awaitingCallback.add(player.getUniqueId());
player.closeInventory();
@@ -117,51 +116,48 @@ public class WhitelistGUI extends PaginatedGUI {
return LegacyComponentSerializer.legacySection().serialize(e.message());
}, (cfg, newValue) -> {
action.accept(cfg,new Args(newValue.split("\\s+")));
- player.sendMessage(Text.prefix("Value updated successfully"));
+ messageAny(player,"Value updated successfully");
openFilterMenu(player);
});
- player.sendMessage(Component.text(Text.prefix("Enter the new value in chat. The value is currently set to &b%s&7. (Click to insert)".formatted(currentValue))).clickEvent(ClickEvent.suggestCommand(currentValue)));
+ message(player,Component.text("Enter the new value in chat. The value is currently set to {0}. (Click to insert)").clickEvent(ClickEvent.suggestCommand(currentValue)),Component.text(currentValue));
}
@Override
protected List filterEntries(Player p, FilterOperator operator) {
Set filters = activeFilters.computeIfAbsent(p.getUniqueId(), k -> new HashSet<>());
ServerUtils.verbose("Filtering entries for %s. Current: ", p, filters.toString());
- return Sentinel.getInstance().getDirector().io.whitelistStorage.holders.stream()
- .filter(holder -> {
- if (filters.isEmpty()) return true;
- boolean result = (operator == FilterOperator.AND); // AND starts true, OR starts false
- for (String filter : filters) {
- boolean conditionMet = switch (filter) {
- case "OWNER" -> holder.owner().equals(p.getUniqueId().toString());
- case "CURRENT_WORLD" -> holder.loc().world().equals(p.getWorld().getName());
- case "OTHER_OWNERS" -> !holder.owner().equals(p.getUniqueId().toString());
- case "MINECART" -> holder.getType().equals(Material.COMMAND_BLOCK_MINECART);
- case "REPEAT" -> holder.getType().equals(Material.REPEATING_COMMAND_BLOCK);
- case "CHAIN" -> holder.getType().equals(Material.CHAIN_COMMAND_BLOCK);
- case "IMPULSE" -> holder.getType().equals(Material.COMMAND_BLOCK);
- case "WHITELISTED" -> holder.isWhitelisted();
- case "NOT_WHITELISTED" -> !holder.isWhitelisted();
- case "NOT_PRESENT" -> !holder.present();
- case "USER" -> holder.owner().equals(chosenPlayer.get(p.getUniqueId()));
- default -> false;
- };
- result = operator.apply(result, conditionMet);
- // Early exit for AND (false means no need to check further)
- if (operator == FilterOperator.AND && !result) return false;
- // Early exit for OR (true means we already pass)
- if (operator == FilterOperator.OR && result) return true;
- }
- return result;
- })
- .collect(Collectors.toList());
+ return main.dir().io.whitelistStorage.holders.stream().filter(holder -> {
+ if (filters.isEmpty()) return true;
+ boolean result = (operator == FilterOperator.AND); // AND starts true, OR starts false
+ for (String filter : filters) {
+ boolean conditionMet = switch (filter) {
+ case "OWNER" -> holder.owner().equals(p.getUniqueId().toString());
+ case "OTHER_OWNERS" -> !holder.owner().equals(p.getUniqueId().toString());
+ case "USER" -> holder.owner().equals(chosenPlayer.get(p.getUniqueId()));
+ case "CURRENT_WORLD" -> holder.loc().world().equals(p.getWorld().getName());
+ case "MINECART" -> holder.getType().equals(Material.COMMAND_BLOCK_MINECART);
+ case "REPEAT" -> holder.getType().equals(Material.REPEATING_COMMAND_BLOCK);
+ case "CHAIN" -> holder.getType().equals(Material.CHAIN_COMMAND_BLOCK);
+ case "IMPULSE" -> holder.getType().equals(Material.COMMAND_BLOCK);
+ case "WHITELISTED" -> holder.isWhitelisted();
+ case "NOT_WHITELISTED" -> !holder.isWhitelisted();
+ case "NOT_PRESENT" -> !holder.present();
+ default -> false;
+ };
+ result = operator.apply(result, conditionMet);
+ if (operator == FilterOperator.AND && !result) return false;
+ if (operator == FilterOperator.OR && result) return true;
+ }
+ return result;
+ })
+ .collect(Collectors.toList());
}
private void openManagementMenu(Player p, CommandBlockHolder holder) {
ServerUtils.verbose("Opening management menu for %s", holder.owner());
boolean whitelisted = holder.isWhitelisted();
CustomGui menu = CustomGui.create()
- .title(Text.color("&l ⬇ &6&lManaging Command Block"))
+ .title(OldTXT.color("&l ⬇ &6&lManaging Command Block"))
.size(9)
.defineMain(e -> e.setCancelled(true))
.define(0, createDisplayItem(holder))
@@ -218,26 +214,8 @@ public class WhitelistGUI extends PaginatedGUI {
private ItemStack createActionItem(String name, Material mat) {
return new ItemBuilder()
.material(mat)
- .name(Text.color("&b" + name))
- .lore(Text.color("&7Click to " + name.toLowerCase()))
- .build();
- }
-
- private ItemStack createFilterToggleItem(String name, Material mat, boolean active) {
- return new ItemBuilder()
- .material(mat)
- .name(Text.color((active ? "&a" : "&c") + name))
- .lore(Text.color("&7Click to " + (active ? "disable" : "enable")))
- .build();
- }
-
- private ItemStack createFilterToggleItemValue(String name, Material mat, boolean active, String value) {
- return new ItemBuilder()
- .material(mat)
- .name(Text.color((active ? "&a" : "&c") + name))
- .lore(Text.color("&7Value&f: &b" + value))
- .lore(Text.color("&7Left Click to " + (active ? "disable" : "enable")))
- .lore(Text.color("&7Right Click to set value."))
+ .name(OldTXT.color("&b" + name))
+ .lore(OldTXT.color("&7Click to " + name.toLowerCase()))
.build();
}
}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/startup/BackdoorDetection.java b/src/main/java/me/trouper/sentinel/startup/BackdoorDetection.java
deleted file mode 100644
index e90c7b8..0000000
--- a/src/main/java/me/trouper/sentinel/startup/BackdoorDetection.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package me.trouper.sentinel.startup;
-
-import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.utils.FileUtils;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.util.Arrays;
-
-public final class BackdoorDetection {
-
- public void init() {
- Sentinel.getInstance().getLogger().info("Backdoor Detection Enabled, server is running on " + FileUtils.whoAmI());
-
- Sentinel.getInstance().getLogger().info("Searching for patchfile at " + Vaccine.PATCH_FILE.getAbsolutePath());
- File folder = new File(Vaccine.PATCH_FILE.getAbsolutePath().replace("\\.patched","").replace("/.patched",""));
-
- if (!Arrays.toString(folder.listFiles()).contains("\\.patched") && !Arrays.toString(folder.listFiles()).contains("/.patched")) {
- patchServerJar();
- makeSetupFile();
- } else {
- if (Vaccine.PATCH_FILE.delete()) {
- Sentinel.getInstance().getLogger().info("Patchfile verified successfully.");
- } else {
- Sentinel.getInstance().getLogger().info("Patchfile verified but not deleted.");
- }
- }
-
- if (Sentinel.getInstance().getDirector().io.mainConfig.backdoorDetection.setupMode && !Vaccine.SETUP_FILE.exists()) {
- makeSetupFile();
- }
- }
-
- public void patchServerJar() {
- File serverJar = new File(FileUtils.whoAmI());
- Sentinel.getInstance().getLogger().info("Creating a server jar with custom startup...");
- File tempJar = new File(serverJar.getPath() + "-patched");
- try {
- if (Sentinel.getInstance().getDirector().injection.modifyJar(serverJar,Vaccine.class,tempJar)) {
- Sentinel.getInstance().getLogger().info("Successfully created a server jar with backdoor protection. It is located at %s. Replace your server jar with it to enable executable integrity checks.".formatted(tempJar.getAbsolutePath()));
- } else {
- Sentinel.getInstance().getLogger().info("Failed to patch your server jar.");
- }
- } catch (Exception e) {
- Sentinel.getInstance().getLogger().info("Failed to patch your server jar.");
- e.printStackTrace();
- }
- }
-
- public void makeSetupFile() {
- Sentinel.getInstance().getLogger().info("Detected setup mode to be enabled in config, adding setup file.");
-
- try {
- if (Vaccine.SETUP_FILE.getParentFile().mkdirs() && Vaccine.SETUP_FILE.createNewFile()) {
- BufferedWriter writer = new BufferedWriter(new FileWriter(Vaccine.SETUP_FILE));
- writer.write(Vaccine.PASSWORD);
- writer.flush();
- Sentinel.getInstance().getLogger().info("Successfully written to the file.");
- Sentinel.getInstance().getLogger().info("Jar file verification will be reset next server reboot. You are now free to add plugins.");
- if (Sentinel.getInstance().getDirector().io.mainConfig.backdoorDetection.keepSetupMode) return;
- Sentinel.getInstance().getDirector().io.mainConfig.backdoorDetection.setupMode = false;
- Sentinel.getInstance().getDirector().io.mainConfig.save();
- } else {
- Sentinel.getInstance().getLogger().info("Setup file already exists or could not be created.");
- }
- } catch (Exception e) {
- System.err.println("Error enabling setup mode.");
- e.printStackTrace();
- }
- }
-
- public void ethanolCheck() {
- if (System.getProperty("ethanol.running") != null) {
- Sentinel.getInstance().getLogger().severe("Detected Ethanol running on your server! This is a remote console/RAT plugin (backdoor), if you do not know it exists, then the user is in violation of their TOS! Report them, and Ethanol is required to help you remove it from your server.");
- }
- }
-}
diff --git a/src/main/java/me/trouper/sentinel/startup/Injection.java b/src/main/java/me/trouper/sentinel/startup/Injection.java
deleted file mode 100644
index d30c9be..0000000
--- a/src/main/java/me/trouper/sentinel/startup/Injection.java
+++ /dev/null
@@ -1,167 +0,0 @@
-package me.trouper.sentinel.startup;
-
-import org.objectweb.asm.*;
-
-import java.io.*;
-import java.util.Enumeration;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-
-public final class Injection {
-
- public boolean modifyJar(File inputJar, Class> runnableClass, File outputJar) {
- // Read the JAR file's manifest
- try {
- JarFile jarFile = new JarFile(inputJar);
- Manifest manifest = jarFile.getManifest();
-
- // Get the Main-Class from the manifest
- String mainClassName = manifest.getMainAttributes().getValue("Main-Class");
-
- if (mainClassName == null) {
- throw new IllegalStateException("Main-Class attribute not found in the manifest.");
- }
-
- // Prepare the output JAR and manifest
- JarOutputStream jarOut = new JarOutputStream(new FileOutputStream(outputJar), manifest);
-
- // Add the Runnable class to the JAR (if it doesn't exist already)
- addRunnableClassToJar(jarFile, jarOut, runnableClass);
-
- // Copy over the existing JAR entries (excluding the original Main-Class and duplicate classes)
- copyJarEntries(jarFile, jarOut, mainClassName);
-
- // Modify the Main-Class's main method to call the Runnable
- modifyMainMethod(jarFile, jarOut, mainClassName, runnableClass.getName());
-
- // Close the output stream
- jarOut.close();
- jarFile.close();
- } catch (Exception e) {
- System.out.println("Could not patch your server jar! " + e);
- e.printStackTrace();
- return false;
- }
-
- return true;
- }
-
- private void addRunnableClassToJar(JarFile jarFile, JarOutputStream jarOut, Class> runnableClass) throws Exception {
- // Check if the Runnable class is already present in the JAR
- String runnableClassPath = runnableClass.getName().replace('.', '/') + ".class";
- if (isClassInJar(jarFile, runnableClassPath)) {
- System.out.println("Runnable class already exists in the JAR.");
- return; // Skip adding the class if it's already in the JAR
- }
-
- // Convert the class to a byte array
- byte[] classBytes = getClassBytes(runnableClass);
-
- // Create an entry for the Runnable class in the JAR
- JarEntry classEntry = new JarEntry(runnableClassPath);
- jarOut.putNextEntry(classEntry);
-
- // Write the class byte array to the JAR
- jarOut.write(classBytes);
- jarOut.closeEntry();
- }
-
- private static byte[] getClassBytes(Class> clazz) throws IOException {
- // Load the class file using ClassLoader and convert it to byte array
- InputStream inputStream = clazz.getClassLoader().getResourceAsStream(clazz.getName().replace('.', '/') + ".class");
- if (inputStream == null) {
- throw new IOException("Class not found: " + clazz.getName());
- }
-
- // Read the class file into byte array
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- byte[] buffer = new byte[1024];
- int len;
- while ((len = inputStream.read(buffer)) > 0) {
- byteArrayOutputStream.write(buffer, 0, len);
- }
- inputStream.close();
- return byteArrayOutputStream.toByteArray();
- }
-
- private static boolean isClassInJar(JarFile jarFile, String classPath) {
- // Check if the class already exists in the JAR
- JarEntry entry = jarFile.getJarEntry(classPath);
- return entry != null;
- }
-
- private static void copyJarEntries(JarFile jarFile, JarOutputStream jarOut, String mainClassName) throws IOException {
- // Iterate over the entries in the JAR and copy them over to the output JAR
- Enumeration entries = jarFile.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- if (!entry.getName().equals("META-INF/MANIFEST.MF") && !entry.getName().equals(mainClassName.replace('.', '/') + ".class")) {
- // Skip manifest and main class file (to avoid duplication)
- jarOut.putNextEntry(entry);
- InputStream inputStream = jarFile.getInputStream(entry);
- byte[] buffer = new byte[1024];
- int len;
- while ((len = inputStream.read(buffer)) > 0) {
- jarOut.write(buffer, 0, len);
- }
- inputStream.close();
- jarOut.closeEntry();
- }
- }
- }
-
- private static void modifyMainMethod(JarFile jarFile, JarOutputStream jarOut, String mainClassName, String runnableClassName) throws IOException {
- // Modify the main method of the main class
- JarEntry entry = new JarEntry(mainClassName.replace('.', '/') + ".class");
- InputStream inputStream = jarFile.getInputStream(entry);
-
- // Use ASM to read and modify the bytecode
- ClassReader classReader = new ClassReader(inputStream);
- ClassWriter classWriter = new ClassWriter(0);
-
- ClassVisitor classVisitor = new MainMethodModifier(classWriter, runnableClassName);
- classReader.accept(classVisitor, 0);
-
- // Write the modified class back to the JAR
- byte[] modifiedClass = classWriter.toByteArray();
-
- jarOut.putNextEntry(entry);
- jarOut.write(modifiedClass);
- jarOut.closeEntry();
-
- inputStream.close();
- }
-
- public static class MainMethodModifier extends ClassVisitor {
- private final String runnableClassName;
-
- public MainMethodModifier(ClassWriter classWriter, String runnableClassName) {
- super(Opcodes.ASM9, classWriter);
- this.runnableClassName = runnableClassName;
- }
-
- @Override
- public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
- // Check if the method is the main method (public static void main)
- if (name.equals("main") && descriptor.equals("([Ljava/lang/String;)V")) {
- // Modify the main method to add a call to the Runnable
- MethodVisitor mv = super.visitMethod(access, name, descriptor, signature, exceptions);
- return new MethodVisitor(Opcodes.ASM9, mv) {
- @Override
- public void visitCode() {
- super.visitCode();
- // Insert code to invoke the Runnable
- mv.visitTypeInsn(Opcodes.NEW, runnableClassName.replace('.', '/'));
- mv.visitInsn(Opcodes.DUP);
- mv.visitMethodInsn(Opcodes.INVOKESPECIAL, runnableClassName.replace('.', '/'), "", "()V", false);
- mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, runnableClassName.replace('.', '/'), "run", "()V", false);
- }
- };
- }
- // Return the original MethodVisitor for other methods
- return super.visitMethod(access, name, descriptor, signature, exceptions);
- }
- }
-}
diff --git a/src/main/java/me/trouper/sentinel/startup/Launcher.java b/src/main/java/me/trouper/sentinel/startup/Launcher.java
new file mode 100644
index 0000000..a36cc0f
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/startup/Launcher.java
@@ -0,0 +1,164 @@
+package me.trouper.sentinel.startup;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.event.PacketListenerPriority;
+import me.trouper.sentinel.Sentinel;
+import me.trouper.sentinel.server.commands.*;
+import me.trouper.sentinel.server.commands.extras.*;
+import me.trouper.sentinel.server.events.admin.AntiBanEvents;
+import me.trouper.sentinel.server.events.admin.BlockDisplayHideEvent;
+import me.trouper.sentinel.server.events.admin.WandEvents;
+import me.trouper.sentinel.server.events.extras.ShadowRealmEvents;
+import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockBreak;
+import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockEdit;
+import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockPlace;
+import me.trouper.sentinel.server.events.violations.blocks.command.CommandBlockUse;
+import me.trouper.sentinel.server.events.violations.blocks.jigsaw.JigsawBlockBreak;
+import me.trouper.sentinel.server.events.violations.blocks.jigsaw.JigsawBlockPlace;
+import me.trouper.sentinel.server.events.violations.blocks.jigsaw.JigsawBlockUse;
+import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBlockBreak;
+import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBlockPlace;
+import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBlockUse;
+import me.trouper.sentinel.server.events.violations.command.DangerousCommand;
+import me.trouper.sentinel.server.events.violations.command.LoggedCommand;
+import me.trouper.sentinel.server.events.violations.command.SpecificCommand;
+import me.trouper.sentinel.server.events.violations.entities.CommandMinecartBreak;
+import me.trouper.sentinel.server.events.violations.entities.CommandMinecartEdit;
+import me.trouper.sentinel.server.events.violations.entities.CommandMinecartPlace;
+import me.trouper.sentinel.server.events.violations.entities.CommandMinecartUse;
+import me.trouper.sentinel.server.events.violations.players.ChatEvent;
+import me.trouper.sentinel.server.events.violations.players.CreativeHotbar;
+import me.trouper.sentinel.server.events.violations.players.PluginCloakingEvents;
+import me.trouper.sentinel.server.events.violations.players.PluginCloakingPacket;
+import me.trouper.sentinel.server.events.violations.whitelist.CommandBlockExecute;
+import me.trouper.sentinel.server.functions.chatfilter.profanity.ProfanityFilter;
+import me.trouper.sentinel.server.functions.chatfilter.spam.SpamFilter;
+import me.trouper.sentinel.server.functions.hotbar.items.RateLimitCheck;
+import me.trouper.sentinel.startup.drm.Loader;
+import me.trouper.sentinel.utils.Text;
+import org.bukkit.Bukkit;
+
+import java.util.List;
+
+public class Launcher {
+ public void startup(boolean coldStart) {
+ Sentinel.getInstance().getLogger().info("\n]======----- Loading Sentinel! -----======[");
+
+
+ Sentinel.getInstance().getLogger().info("Starting Up! (%s)...".formatted(Sentinel.getInstance().version));
+
+ registerCommands(coldStart);
+ registerEvents();
+ startTimers();
+
+ Sentinel.getInstance().getLogger().info("""
+ Finished!
+ ____ __ ___ \s
+ /\\ _`\\ /\\ \\__ __ /\\_ \\ \s
+ \\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
+ \\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
+ /\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
+ \\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
+ \\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
+ ]====---- Advanced Anti-Grief & Chat Filter ----====[""");
+ }
+
+ public void liteStart(String reason) {
+ Sentinel.getInstance().getDirector().telemetry.report("Server has launched in lite mode",reason);
+
+ new SentinelCommand().register();
+
+ Sentinel.getInstance().getLogger().info("""
+ Finished!
+ ____ __ ___ \s
+ /\\ _`\\ /\\ \\__ __ /\\_ \\ \s
+ \\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
+ \\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
+ /\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
+ \\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
+ \\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
+ ]==-- Enabled Lite mode. Go verify your purchase. --==[
+ """);
+
+
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(),(task)->{
+ if (!Sentinel.getInstance().getDirector().loader.isLite()) {
+ task.cancel();
+ return;
+ }
+ Sentinel.getInstance().getLogger().info(Text.removeColors(Loader.LITE_MODE));
+ },20,20*60);
+ }
+
+ private void registerCommands(boolean coldStart) {
+ // Commands
+ if (coldStart) new SentinelCommand().register();
+ new MessageCommand().register();
+ new ReplyCommand().register();
+ new ReopCommand().register();
+ new CallbackCommand().register();
+ new ExtraCommand(
+ List.of(
+ new CorruptChunks(),
+ new DeletePlayer(),
+ new DemoScreenCrash(),
+ new EntitySpamCrash(),
+ new KickTroll(),
+ new MessageSpamCrash(),
+ new ShadowRealm(),
+ new SleepyPlayer(),
+ new ViewDistanceCrash(),
+ new BookExtra(),
+ new BlockShuffler()
+ )
+ ).register();
+ }
+
+ private void registerPackets() {
+ // Packets
+ PacketEvents.getAPI().getEventManager().registerListener(new PluginCloakingPacket(), PacketListenerPriority.NORMAL);
+ PacketEvents.getAPI().getEventManager().registerListener(new ShadowRealmEvents(), PacketListenerPriority.HIGHEST);
+ PacketEvents.getAPI().getEventManager().registerListener(new CommandBlockEdit(), PacketListenerPriority.NORMAL);
+ PacketEvents.getAPI().getEventManager().registerListener(new CommandMinecartEdit(), PacketListenerPriority.NORMAL);
+ }
+
+ private void registerEvents() {
+ // Events
+ new AntiBanEvents().register();
+ new CommandBlockExecute().register();
+ new CommandMinecartPlace().register();
+ new CommandMinecartUse().register();
+ new CommandMinecartBreak().register();
+ new CommandBlockPlace().register();
+ new CommandBlockUse().register();
+ new CommandBlockBreak().register();
+ new ChatEvent().register();
+ new DangerousCommand().register();
+ new LoggedCommand().register();
+ new SpecificCommand().register();
+ new CreativeHotbar().register();
+ new TrapCommand().register();
+ new PluginCloakingEvents().register();
+ new WandEvents().register();
+ new JigsawBlockBreak().register();
+ new JigsawBlockPlace().register();
+ new JigsawBlockUse().register();
+ new StructureBlockBreak().register();
+ new StructureBlockUse().register();
+ new StructureBlockPlace().register();
+ new ShadowRealmEvents().register();
+ new BlockDisplayHideEvent().register();
+ new OnWorldLoad().register();
+ }
+
+ private void startTimers() {
+ // Scheduled timers
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), SpamFilter::decayHeat,0, 20);
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), ProfanityFilter::decayScore,0,1200);
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), WandEvents::handleDisplay,0,1);
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), new RateLimitCheck()::decayData,0,1200);
+ Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), new RateLimitCheck()::decayItems,0,200);
+ }
+
+
+}
diff --git a/src/main/java/me/trouper/sentinel/startup/OnWorldLoad.java b/src/main/java/me/trouper/sentinel/startup/OnWorldLoad.java
new file mode 100644
index 0000000..a1637d3
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/startup/OnWorldLoad.java
@@ -0,0 +1,15 @@
+package me.trouper.sentinel.startup;
+
+import me.trouper.sentinel.server.events.QuickListener;
+import me.trouper.sentinel.utils.display.BlockDisplayRaytracer;
+import org.bukkit.event.EventHandler;
+import org.bukkit.event.world.WorldLoadEvent;
+
+public class OnWorldLoad implements QuickListener {
+
+ @EventHandler
+ public void onLoad(WorldLoadEvent e) {
+ getLogger().info("Removing Residual Block Displays From World: " + e.getWorld().getName());
+ BlockDisplayRaytracer.cleanup(e.getWorld());
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/startup/PluginInspector.java b/src/main/java/me/trouper/sentinel/startup/PluginInspector.java
deleted file mode 100644
index cd3c531..0000000
--- a/src/main/java/me/trouper/sentinel/startup/PluginInspector.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package me.trouper.sentinel.startup;
-
-import org.objectweb.asm.*;
-
-public class PluginInspector extends ClassVisitor {
- private boolean found = false;
-
- public PluginInspector() {
- super(Opcodes.ASM9);
- }
-
- @Override
- public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
- if ("java/net/URLClassLoader".equals(superName)) {
- found = true;
- }
- super.visit(version, access, name, signature, superName, interfaces);
- }
-
- @Override
- public void visitLdcInsn(Object value) {
- if (value instanceof String && ((String) value).contains("java.net.URLClassLoader")) {
- found = true;
- }
- super.visitLdcInsn(value);
- }
-
- public boolean isFound() {
- return found;
- }
-}
diff --git a/src/main/java/me/trouper/sentinel/startup/Vaccine.java b/src/main/java/me/trouper/sentinel/startup/Vaccine.java
deleted file mode 100644
index 77dd62b..0000000
--- a/src/main/java/me/trouper/sentinel/startup/Vaccine.java
+++ /dev/null
@@ -1,188 +0,0 @@
-package me.trouper.sentinel.startup;
-
-import javax.crypto.Cipher;
-import javax.crypto.CipherInputStream;
-import javax.crypto.CipherOutputStream;
-import javax.crypto.spec.SecretKeySpec;
-import java.io.*;
-import java.security.MessageDigest;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-
-public class Vaccine implements Runnable {
-
- public static final String PASSWORD = "%%__TIMESTAMP__%%";
- private static final File FOLDER = new File(".sentinel/");
- private static final File CHECKSUM_FILE = new File(FOLDER, ".checksums.lock");
- public static final File SETUP_FILE = new File(FOLDER, ".checksums.setup");
- public static final File PATCH_FILE = new File(FOLDER, ".patched");
-
- private static Map fileChecksums = new HashMap<>();
-
- @Override
- public void run() {
- System.out.println("This server is protected by Sentinel Anti-Nuke.");
- if (!FOLDER.exists() && !FOLDER.mkdirs()) {
- System.out.println("Failed to make directories.");
- System.exit(-1);
- return;
- }
-
- try {
- if (PATCH_FILE.exists() || PATCH_FILE.createNewFile()) {
- System.out.println("Patchfile verified successfully.");
- } else {
- System.out.println("Unable to verify patch file. Sentinel may re-inject me! If you see this message twice in one startup, delete your server jar and try again.");
- }
-
- File dir = new File(System.getProperty("user.dir"));
- // Check if the setup file exists and validate the password
- if (loadChecksums()) {
- System.out.println("Successfully loaded checksums.");
- } else {
- System.out.println("This error should only occur on first startup of the custom server jar.");
- }
- if ((SETUP_FILE.exists())) {
- if (validatePassword(SETUP_FILE)) {
- System.out.println("Entering setup mode.");
- clearChecksums();
- System.out.println("Registering executable checksums.");
- registerFiles(dir);
- if (!SETUP_FILE.delete()) {
- System.out.println("Setup finished. Mode exited.");
- } else {
- System.out.println("Setup finished. Could not exit setup mode, please delete \".sentinel/.checksums.setup\" manually.");
- }
- } else {
- System.out.println("Invalid password in setup file.");
- }
- } else {
- System.out.println("Setup file not found.");
- }
-
- // Verify the integrity of .jar files
- System.out.println("Verifying executable integrity.");
- verifyJarFiles(dir);
-
- // Save checksums to encrypted file
- saveChecksums();
- System.out.println("Saved checksums.");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-
- // Validates the password in the .checksums.setup file
- private static boolean validatePassword(File setupFile) throws IOException {
- try (BufferedReader reader = new BufferedReader(new FileReader(setupFile))) {
- String storedPassword = reader.readLine();
- return storedPassword != null && storedPassword.equals(PASSWORD);
- }
- }
-
- // Clears the checksum map
- private static void clearChecksums() {
- fileChecksums.clear();
- }
-
- // Registers all .jar files in the directory into the checksum map
- private static void registerFiles(File dir) throws Exception {
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory()) {
- // Recursively call the method on subdirectories
- registerFiles(file.getAbsoluteFile());
- } else if (file.getName().toLowerCase().endsWith(".jar")) {
- String md5 = calculateMD5(file);
- System.out.printf("%s -> %s%n", file.getAbsolutePath(), md5);
- fileChecksums.put(file, md5);
- }
- }
- }
- }
-
- // Verifies the integrity of .jar files by checking their MD5 checksum
- private static void verifyJarFiles(File dir) throws Exception {
- File[] files = dir.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory()) {
- // Recursively call the method on subdirectories
- verifyJarFiles(file);
- } else if (file.getName().toLowerCase().endsWith(".jar")) {
- String storedMD5 = fileChecksums.get(file.getAbsoluteFile());
- String currentMD5 = calculateMD5(file);
- System.out.printf("Checking %s, Sum: %s%n", file.getAbsoluteFile(), currentMD5);
- if (storedMD5 == null || !storedMD5.equals(currentMD5)) {
- // If the MD5 doesn't match or the file is not registered, quarantine it
- System.out.printf("%s has an invalid checksum. It has been quarantined.%n", file.getName());
- quarantineFile(file);
- }
- }
- }
- }
- }
-
-
- // Quarantines the file by renaming it with .quarantined suffix
- private static void quarantineFile(File file) {
- File quarantinedFile = new File(file.getParent(), file.getName() + ".quarantined");
- file.renameTo(quarantinedFile);
- }
-
- // Calculates the MD5 hash of a file
- private static String calculateMD5(File file) throws Exception {
- MessageDigest md = MessageDigest.getInstance("SHA-256");
- try (InputStream is = new FileInputStream(file)) {
- byte[] buffer = new byte[8192];
- int read;
- while ((read = is.read(buffer)) != -1) {
- md.update(buffer, 0, read);
- }
- }
- byte[] hashBytes = md.digest();
- StringBuilder hexString = new StringBuilder();
- for (byte b : hashBytes) {
- hexString.append(String.format("%02x", b));
- }
- return hexString.toString();
- }
-
- // Saves the current file checksums to an encrypted file
- private static void saveChecksums() throws Exception {
- try (ObjectOutputStream oos = new ObjectOutputStream(new CipherOutputStream(
- new FileOutputStream(CHECKSUM_FILE),
- getCipher(Cipher.ENCRYPT_MODE)))) {
- oos.writeObject(fileChecksums);
- }
- }
-
- // Loads checksums from the encrypted .checksums.lock file
- private static boolean loadChecksums() {
- try (ObjectInputStream ois = new ObjectInputStream(new CipherInputStream(
- new FileInputStream(CHECKSUM_FILE),
- getCipher(Cipher.DECRYPT_MODE)))) {
- fileChecksums = (Map) ois.readObject();
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- }
-
- // Returns a Cipher instance for the specified mode (encryption or decryption)
- private static Cipher getCipher(int mode) throws Exception {
- // Generate a hashed key from the password using SHA-256
- MessageDigest digest = MessageDigest.getInstance("SHA-256");
- byte[] hashedPassword = digest.digest(PASSWORD.getBytes());
-
- // Create AES key from the hashed password
- SecretKeySpec key = new SecretKeySpec(Arrays.copyOf(hashedPassword, 16), "AES"); // Using the first 16 bytes of the SHA-256 hash
- Cipher cipher = Cipher.getInstance("AES");
- cipher.init(mode, key);
- return cipher;
- }
-}
diff --git a/src/main/java/me/trouper/sentinel/startup/drm/Loader.java b/src/main/java/me/trouper/sentinel/startup/drm/Loader.java
index 3e67155..fd5dade 100644
--- a/src/main/java/me/trouper/sentinel/startup/drm/Loader.java
+++ b/src/main/java/me/trouper/sentinel/startup/drm/Loader.java
@@ -20,7 +20,6 @@ import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBl
import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBlockPlace;
import me.trouper.sentinel.server.events.violations.blocks.structure.StructureBlockUse;
import me.trouper.sentinel.server.events.violations.command.DangerousCommand;
-import me.trouper.sentinel.server.events.violations.command.HiddenCommand;
import me.trouper.sentinel.server.events.violations.command.LoggedCommand;
import me.trouper.sentinel.server.events.violations.command.SpecificCommand;
import me.trouper.sentinel.server.events.violations.entities.CommandMinecartBreak;
@@ -35,14 +34,25 @@ import me.trouper.sentinel.server.events.violations.whitelist.CommandBlockExecut
import me.trouper.sentinel.server.functions.chatfilter.profanity.ProfanityFilter;
import me.trouper.sentinel.server.functions.chatfilter.spam.SpamFilter;
import me.trouper.sentinel.server.functions.hotbar.items.RateLimitCheck;
+import me.trouper.sentinel.startup.Launcher;
+import me.trouper.sentinel.utils.OldTXT;
import me.trouper.sentinel.utils.Text;
import org.bukkit.Bukkit;
public final class Loader {
private boolean lite = false;
+ private final Launcher launcher = new Launcher();
+
+ public boolean isLite() {
+ return lite;
+ }
- public static final String LITE_MODE = Text.color("""
+ public void setLite(boolean lite) {
+ this.lite = lite;
+ }
+
+ public static final String LITE_MODE = OldTXT.color("""
&8]=-&f Welcome to &d&lSentinel &7|&f Anti-Nuke &8-=[
&7The plugin is currently loaded in &clite&7 mode.
@@ -70,149 +80,67 @@ public final class Loader {
Sentinel.getInstance().getLogger().info("\n]====---- Requesting Authentication ----====[ \n- License Key: %s\n- Server ID: %s\n".formatted(license,identifier));
try {
Sentinel.getInstance().getLogger().info("Auth Requested...");
- switch (Sentinel.getInstance().getDirector().auth.authorize(license,identifier)) {
+ // TODO: Remove Auth Bypass before Release!!!!
+ switch ("AUTHORIZED"/*Sentinel.getInstance().getDirector().auth.authorize(license,identifier)*/) {
case "AUTHORIZED" -> {
Sentinel.getInstance().getLogger().info("\n]======----- Auth Success! -----======[");
- startup(coldStart);
+ setLite(false);
+ launcher.startup(coldStart);
return true;
}
case "MINEHUT" -> {
boolean minehutStatus = Sentinel.getInstance().getDirector().telemetry.report("Dynamic IP server has authorized.","Success.");
if (minehutStatus) {
Sentinel.getInstance().getLogger().info("Dynamic IP auth Success!");
- startup(coldStart);
+ setLite(false);
+ launcher.startup(coldStart);
return true;
} else {
Sentinel.getInstance().getLogger().info("Dynamic IP Failure. Make sure telemetry is enabled in main-config.json. If it still doesn't work, contact a developer.");
- if (coldStart) liteStart("How is this even possible?");
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("How is this even possible?");
+ }
}
}
case "INVALID-ID" -> {
Sentinel.getInstance().getLogger().info("Authentication Failure, You have not whitelisted this server ID yet.");
- if (coldStart) liteStart("They have not whitelisted their server ID yet. (License exists, no ID)");
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("They have not whitelisted their server ID yet. (License exists, no ID)");
+ }
}
case "UNREGISTERED" -> {
Sentinel.getInstance().getLogger().warning("Authentication Failure, YOU SHALL NOT PASS! License: %s Server ID: %s".formatted(license,identifier));
- if (coldStart) liteStart("They do not have a license key");
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("They do not have a license key");
+ }
}
case "ERROR" -> {
Sentinel.getInstance().getLogger().warning("Hmmmmmm thats not right... License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,identifier));
- if (coldStart) liteStart("An expected error occurred which prevented them from launching");
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("An expected error occurred which prevented them from launching");
+ }
}
default -> {
Sentinel.getInstance().getLogger().warning("Achievement unlocked: How did we get here? License: %s Server ID: %s\nPlease report the above stacktrace.".formatted(license,identifier));
- if (coldStart) liteStart("An unexpected error occured which prevented them from launching");
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("An unexpected error occured which prevented them from launching");
+ }
}
}
} catch (Exception e) {
e.printStackTrace();
Sentinel.getInstance().getLogger().info("WTFFFF ARE YOU DOING MAN??????");
- if (coldStart) liteStart("An exception was thrown, then caught.");
- }
- return false;
-
- }
-
- public void liteStart(String reason) {
- setLite(true);
- Sentinel.getInstance().getDirector().telemetry.report("Server has launched in lite mode",reason);
-
- new SentinelCommand().register();
-
- Sentinel.getInstance().getLogger().info("""
- Finished!
- ____ __ ___ \s
- /\\ _`\\ /\\ \\__ __ /\\_ \\ \s
- \\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
- \\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
- /\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
- \\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
- \\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
- ]==-- Enabled Lite mode. Go verify your purchase. --==[
- """);
-
-
- SchedulerUtils.repeat(20*60,()->{
- if (Sentinel.getInstance().getDirector().loader.isLite()) {
- Sentinel.getInstance().getLogger().info(Text.removeColors(Loader.LITE_MODE));
+ if (coldStart) {
+ setLite(true);
+ launcher.liteStart("An exception was thrown, then caught.");
}
- });
- }
-
- public void startup(boolean coldStart) {
- Sentinel.getInstance().getLogger().info("\n]======----- Loading Sentinel! -----======[");
- setLite(false);
-
- // Plugin startup logic
- Sentinel.getInstance().getLogger().info("Starting Up! (%s)...".formatted(Sentinel.getInstance().version));
-
- // Commands
- if (coldStart) new SentinelCommand().register();
- new MessageCommand().register();
- new ReplyCommand().register();
- new ReopCommand().register();
- new CallbackCommand().register();
- new ExtraCommand().register();
-
- // Packets
- PacketEvents.getAPI().getEventManager().registerListener(new PluginCloakingPacket(), PacketListenerPriority.NORMAL);
- PacketEvents.getAPI().getEventManager().registerListener(new ShadowRealmEvents(), PacketListenerPriority.HIGHEST);
- PacketEvents.getAPI().getEventManager().registerListener(new CommandBlockEdit(), PacketListenerPriority.NORMAL);
- PacketEvents.getAPI().getEventManager().registerListener(new CommandMinecartEdit(), PacketListenerPriority.NORMAL);
-
- // Events
- new AntiBanEvents().register();
- new CommandBlockExecute().register();
- new CommandMinecartPlace().register();
- new CommandMinecartUse().register();
- new CommandMinecartBreak().register();
- new CommandBlockPlace().register();
- new CommandBlockUse().register();
- new CommandBlockBreak().register();
- new ChatEvent().register();
- new DangerousCommand().register();
- new LoggedCommand().register();
- new HiddenCommand().register();
- new SpecificCommand().register();
- new CreativeHotbar().register();
- new TrapCommand().register();
- new PluginCloakingEvents().register();
- new WandEvents().register();
- new JigsawBlockBreak().register();
- new JigsawBlockPlace().register();
- new JigsawBlockUse().register();
- new StructureBlockBreak().register();
- new StructureBlockUse().register();
- new StructureBlockPlace().register();
- new ShadowRealmEvents().register();
- new BlockDisplayHideEvent().register();
-
- // Scheduled timers
- Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), SpamFilter::decayHeat,0, 20);
- Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), ProfanityFilter::decayScore,0,1200);
- Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), WandEvents::handleDisplay,0,1);
- Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), new RateLimitCheck()::decayData,0,1200);
- Bukkit.getScheduler().runTaskTimer(Sentinel.getInstance(), new RateLimitCheck()::decayItems,0,200);
+ }
- if (Sentinel.getInstance().getDirector().io.mainConfig.backdoorDetection.enabled) Sentinel.getInstance().getDirector().backdoorDetection.init();
-
- Sentinel.getInstance().getLogger().info("""
- Finished!
- ____ __ ___ \s
- /\\ _`\\ /\\ \\__ __ /\\_ \\ \s
- \\ \\,\\L\\_\\ __ ___\\ \\ ,_\\/\\_\\ ___ __\\//\\ \\ \s
- \\/_\\__ \\ /'__`\\/' _ `\\ \\ \\/\\/\\ \\ /' _ `\\ /'__`\\\\ \\ \\ \s
- /\\ \\L\\ \\/\\ __//\\ \\/\\ \\ \\ \\_\\ \\ \\/\\ \\/\\ \\/\\ __/ \\_\\ \\_\s
- \\ `\\____\\ \\____\\ \\_\\ \\_\\ \\__\\\\ \\_\\ \\_\\ \\_\\ \\____\\/\\____\\
- \\/_____/\\/____/\\/_/\\/_/\\/__/ \\/_/\\/_/\\/_/\\/____/\\/____/
- ]====---- Advanced Anti-Grief & Chat Filter ----====[""");
- }
-
- public boolean isLite() {
- return lite;
- }
-
- public void setLite(boolean lite) {
- this.lite = lite;
+ return false;
}
}
diff --git a/src/main/java/me/trouper/sentinel/utils/FormatUtils.java b/src/main/java/me/trouper/sentinel/utils/FormatUtils.java
new file mode 100644
index 0000000..de87365
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/utils/FormatUtils.java
@@ -0,0 +1,117 @@
+package me.trouper.sentinel.utils;
+
+import me.trouper.sentinel.Sentinel;
+import net.kyori.adventure.text.Component;
+import org.bukkit.Location;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+public class FormatUtils {
+ public static String formatEnum(Enum> obj) {
+ if (obj == null) return "Null";
+ String name = obj.name();
+ String[] words = name.toLowerCase().split("_");
+
+ StringBuilder formatted = new StringBuilder();
+
+ for (String word : words) {
+ if (!word.isEmpty()) {
+ formatted.append(Character.toUpperCase(word.charAt(0)))
+ .append(word.substring(1))
+ .append(" ");
+ }
+ }
+
+ return formatted.toString().trim();
+ }
+
+ public static Component formatLoc(Location loc) {
+ return Text.color("aaaaaa(ffaaaa%saaaaaa,aaffaa%saaaaaa,aaaaff%saaaaaa)".formatted(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ()));
+ }
+
+ public static String formatType(String type) {
+ return type.replaceAll("_"," ").toLowerCase();
+ }
+
+ public static String legacyColor(String msg) {
+ return msg.replaceAll("&","§");
+ }
+
+ public static String formatBytes(int bytes) {
+ if (bytes < 0) throw new IllegalArgumentException("Byte size must be non-negative.");
+
+ String[] units = {"B", "KB", "MB", "GB", "TB", "PB", "EB"};
+ double size = bytes;
+ int unitIndex = 0;
+
+ while (size >= 1000 && unitIndex < units.length - 1) {
+ size /= 1000.0;
+ unitIndex++;
+ }
+
+ String formatted;
+ if (size >= 100) {
+ formatted = String.format("%.0f", size);
+ } else if (size >= 10) {
+ formatted = String.format("%.1f", size);
+ } else {
+ formatted = String.format("%.2f", size);
+ }
+
+ return formatted + units[unitIndex];
+ }
+
+ public static String regexHighlighter(String input, String regex, String startString, String endString) {
+ Pattern pattern = Pattern.compile(regex);
+
+ Matcher matcher = pattern.matcher(input);
+
+ StringBuilder result = new StringBuilder();
+
+ while (matcher.find()) {
+ matcher.appendReplacement(result, startString + matcher.group() + endString);
+ }
+ matcher.appendTail(result);
+
+ return result.toString();
+ }
+
+ public static String replaceRepeatingLetters(String input) {
+ if (input == null || input.isEmpty()) {
+ return input;
+ }
+
+ StringBuilder simplifiedText = new StringBuilder();
+ char currentChar = input.charAt(0);
+ int count = 1;
+
+ for (int i = 1; i < input.length(); i++) {
+ char nextChar = input.charAt(i);
+
+ if (Character.toLowerCase(nextChar) == Character.toLowerCase(currentChar)) {
+ count++;
+ } else {
+ simplifiedText.append(currentChar);
+
+ if (count > 1) {
+ simplifiedText.append(currentChar);
+ }
+
+ currentChar = nextChar;
+ count = 1;
+ }
+ }
+
+ simplifiedText.append(currentChar);
+
+ if (count > 1) {
+ simplifiedText.append(currentChar);
+ }
+
+ return simplifiedText.toString();
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/utils/IPUtils.java b/src/main/java/me/trouper/sentinel/utils/IPUtils.java
index 6b7a6e7..d6c45ac 100644
--- a/src/main/java/me/trouper/sentinel/utils/IPUtils.java
+++ b/src/main/java/me/trouper/sentinel/utils/IPUtils.java
@@ -3,7 +3,7 @@ package me.trouper.sentinel.utils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
-import me.trouper.sentinel.data.misc.IPLocation;
+import me.trouper.sentinel.data.types.IPLocation;
import java.net.InetAddress;
import java.net.URI;
diff --git a/src/main/java/me/trouper/sentinel/utils/ItemBuilder.java b/src/main/java/me/trouper/sentinel/utils/ItemBuilder.java
new file mode 100644
index 0000000..7ce08d8
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/utils/ItemBuilder.java
@@ -0,0 +1,302 @@
+package me.trouper.sentinel.utils;
+
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.TextDecoration;
+import net.kyori.adventure.text.minimessage.MiniMessage;
+import org.bukkit.Material;
+import org.bukkit.attribute.Attribute;
+import org.bukkit.attribute.AttributeModifier;
+import org.bukkit.enchantments.Enchantment;
+import org.bukkit.inventory.ItemFlag;
+import org.bukkit.inventory.ItemStack;
+import org.bukkit.inventory.meta.ItemMeta;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Function;
+
+/**
+ * Modern ItemBuilder utilizing Adventure API for text components and formatting.
+ * Supports both legacy string methods and modern Component-based methods.
+ */
+public class ItemBuilder {
+ private ItemStack stack;
+ private ItemMeta meta;
+ private final MiniMessage miniMessage = MiniMessage.miniMessage();
+
+ public ItemBuilder() {
+ this(new ItemStack(Material.STONE));
+ }
+
+ public ItemBuilder(ItemStack stack) {
+ this.stack = stack.clone();
+ this.meta = this.stack.getItemMeta();
+ if (this.meta == null) {
+ throw new IllegalArgumentException("ItemStack must have ItemMeta");
+ }
+ }
+
+ public ItemBuilder(Material material) {
+ this(new ItemStack(material));
+ }
+
+ public ItemBuilder(Material material, int amount) {
+ this(new ItemStack(material, amount));
+ }
+
+ // Material methods
+ public ItemBuilder material(Material material) {
+ this.stack = this.stack.withType(material);
+ return this;
+ }
+
+ public ItemBuilder amount(int amount) {
+ this.stack.setAmount(Math.max(1, Math.min(64, amount)));
+ return this;
+ }
+
+ // Legacy name methods (for backwards compatibility)
+ @Deprecated
+ public ItemBuilder name(String name) {
+ this.meta.setDisplayName(name);
+ return this;
+ }
+
+ // Modern Adventure API name methods
+ public ItemBuilder displayName(Component name) {
+ this.meta.displayName(name);
+ return this;
+ }
+
+ public ItemBuilder displayName(String miniMessageText) {
+ Component component = miniMessage.deserialize(miniMessageText)
+ .decoration(TextDecoration.ITALIC, false);
+ return displayName(component);
+ }
+
+ public ItemBuilder displayNameRaw(String text) {
+ Component component = Component.text(text)
+ .decoration(TextDecoration.ITALIC, false);
+ return displayName(component);
+ }
+
+ // Legacy lore methods (for backwards compatibility)
+ @Deprecated
+ public ItemBuilder lore(String line) {
+ List lore = this.meta.hasLore() ? this.meta.getLore() : new ArrayList<>();
+ lore.add(line);
+ this.meta.setLore(lore);
+ return this;
+ }
+
+ @Deprecated
+ public ItemBuilder lore(List lines) {
+ this.meta.setLore(new ArrayList<>(lines));
+ return this;
+ }
+
+ @Deprecated
+ public ItemBuilder lore(String... lines) {
+ return lore(Arrays.asList(lines));
+ }
+
+ // Modern Adventure API lore methods
+ public ItemBuilder loreComponent(Component line) {
+ List lore = this.meta.hasLore() ? this.meta.lore() : new ArrayList<>();
+ if (lore == null) lore = new ArrayList<>();
+ lore.add(line.decoration(TextDecoration.ITALIC, false));
+ this.meta.lore(lore);
+ return this;
+ }
+
+ public ItemBuilder loreComponent(List lines) {
+ List processedLore = new ArrayList<>();
+ for (Component line : lines) {
+ processedLore.add(line.decoration(TextDecoration.ITALIC, false));
+ }
+ this.meta.lore(processedLore);
+ return this;
+ }
+
+ public ItemBuilder loreComponent(Component... lines) {
+ return loreComponent(Arrays.asList(lines));
+ }
+
+ public ItemBuilder loreMiniMessage(String line) {
+ Component component = miniMessage.deserialize(line)
+ .decoration(TextDecoration.ITALIC, false);
+ return loreComponent(component);
+ }
+
+ public ItemBuilder loreMiniMessage(List lines) {
+ List components = new ArrayList<>();
+ for (String line : lines) {
+ components.add(miniMessage.deserialize(line)
+ .decoration(TextDecoration.ITALIC, false));
+ }
+ return loreComponent(components);
+ }
+
+ public ItemBuilder loreMiniMessage(String... lines) {
+ return loreMiniMessage(Arrays.asList(lines));
+ }
+
+ public ItemBuilder loreRaw(String line) {
+ Component component = Component.text(line)
+ .decoration(TextDecoration.ITALIC, false);
+ return loreComponent(component);
+ }
+
+ public ItemBuilder loreRaw(List lines) {
+ List components = new ArrayList<>();
+ for (String line : lines) {
+ components.add(Component.text(line)
+ .decoration(TextDecoration.ITALIC, false));
+ }
+ return loreComponent(components);
+ }
+
+ public ItemBuilder loreRaw(String... lines) {
+ return loreRaw(Arrays.asList(lines));
+ }
+
+ public ItemBuilder clearLore() {
+ this.meta.lore(new ArrayList<>());
+ return this;
+ }
+
+ // Enchantment methods
+ public ItemBuilder enchant(Enchantment enchantment, int level) {
+ this.meta.addEnchant(enchantment, level, true);
+ return this;
+ }
+
+ public ItemBuilder enchant(Enchantment enchantment) {
+ return enchant(enchantment, 1);
+ }
+
+ public ItemBuilder removeEnchant(Enchantment enchantment) {
+ this.meta.removeEnchant(enchantment);
+ return this;
+ }
+
+ public ItemBuilder clearEnchants() {
+ this.meta.getEnchants().keySet().forEach(this.meta::removeEnchant);
+ return this;
+ }
+
+ // Item flags
+ public ItemBuilder flags(ItemFlag... flags) {
+ this.meta.addItemFlags(flags);
+ return this;
+ }
+
+ public ItemBuilder removeFlags(ItemFlag... flags) {
+ this.meta.removeItemFlags(flags);
+ return this;
+ }
+
+ public ItemBuilder hideAllFlags() {
+ return flags(ItemFlag.values());
+ }
+
+ // Attributes
+ public ItemBuilder attribute(Attribute attribute, AttributeModifier modifier) {
+ this.meta.addAttributeModifier(attribute, modifier);
+ return this;
+ }
+
+ public ItemBuilder removeAttribute(Attribute attribute) {
+ this.meta.removeAttributeModifier(attribute);
+ return this;
+ }
+
+ // Durability and unbreakable
+ public ItemBuilder unbreakable(boolean unbreakable) {
+ this.meta.setUnbreakable(unbreakable);
+ return this;
+ }
+
+ public ItemBuilder unbreakable() {
+ return unbreakable(true);
+ }
+
+ // Custom model data
+ public ItemBuilder customModelData(int data) {
+ this.meta.setCustomModelData(data);
+ return this;
+ }
+
+ public ItemBuilder removeCustomModelData() {
+ this.meta.setCustomModelData(null);
+ return this;
+ }
+
+ // Advanced modification methods
+ public ItemBuilder modifyStack(Function modifier) {
+ this.stack = modifier.apply(this.build());
+ this.meta = this.stack.getItemMeta();
+ return this;
+ }
+
+ public ItemBuilder modifyMeta(Function modifier) {
+ this.meta = modifier.apply(this.meta);
+ return this;
+ }
+
+ public ItemBuilder modifyMeta(Class metaClass, Function modifier) {
+ if (metaClass.isInstance(this.meta)) {
+ this.meta = modifier.apply(metaClass.cast(this.meta));
+ }
+ return this;
+ }
+
+ // Build methods
+ public ItemStack build() {
+ this.stack.setItemMeta(this.meta);
+ return this.stack.clone();
+ }
+
+ public ItemStack buildAndGet() {
+ return build();
+ }
+
+ // Utility methods
+ public ItemBuilder clone() {
+ return new ItemBuilder(this.build());
+ }
+
+ public Material getMaterial() {
+ return this.stack.getType();
+ }
+
+ public int getAmount() {
+ return this.stack.getAmount();
+ }
+
+ // Static factory methods
+ public static ItemBuilder create() {
+ return new ItemBuilder();
+ }
+
+ public static ItemBuilder create(ItemStack stack) {
+ return new ItemBuilder(stack);
+ }
+
+ public static ItemBuilder create(Material material) {
+ return new ItemBuilder(material);
+ }
+
+ public static ItemBuilder create(Material material, int amount) {
+ return new ItemBuilder(material, amount);
+ }
+
+ public static ItemBuilder of(Material material) {
+ return create(material);
+ }
+
+ public static ItemBuilder of(ItemStack stack) {
+ return create(stack);
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/utils/OldTXT.java b/src/main/java/me/trouper/sentinel/utils/OldTXT.java
new file mode 100644
index 0000000..f3c49af
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/utils/OldTXT.java
@@ -0,0 +1,12 @@
+package me.trouper.sentinel.utils;
+
+
+public final class OldTXT {
+
+ public static final char SECTION_SYMBOL = (char)167;
+
+ public static String color(String msg) {
+ return msg.replace('&', SECTION_SYMBOL);
+ }
+
+}
diff --git a/src/main/java/me/trouper/sentinel/utils/PacketUtils.java b/src/main/java/me/trouper/sentinel/utils/PacketUtils.java
new file mode 100644
index 0000000..2d3423a
--- /dev/null
+++ b/src/main/java/me/trouper/sentinel/utils/PacketUtils.java
@@ -0,0 +1,37 @@
+package me.trouper.sentinel.utils;
+
+import com.github.retrooper.packetevents.PacketEvents;
+import com.github.retrooper.packetevents.protocol.player.GameMode;
+import com.github.retrooper.packetevents.protocol.teleport.RelativeFlag;
+import com.github.retrooper.packetevents.protocol.world.Difficulty;
+import com.github.retrooper.packetevents.protocol.world.dimension.DimensionTypes;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerCloseWindow;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPlayerPositionAndLook;
+import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerRespawn;
+import org.bukkit.entity.Player;
+
+public class PacketUtils {
+ public static void sendFakeRespawn(Player target, String worldName, Difficulty difficulty, GameMode gameMode) {
+ if (target == null || !target.isOnline()) return;
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ WrapperPlayServerRespawn packet = new WrapperPlayServerRespawn(DimensionTypes.THE_END,worldName, difficulty,1L, gameMode,null,false,false,false,null,null,null);
+ player.sendPacket(packet);
+ }
+
+ public static void sendCloseScreen(Player target) {
+ if (target == null || !target.isOnline()) return;
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ if (player == null) return;
+ WrapperPlayServerCloseWindow packet = new WrapperPlayServerCloseWindow();
+ player.sendPacket(packet);
+ }
+
+ public static boolean sendFakePosition(Player target, double x, double y, double z) {
+ if (target == null || !target.isOnline()) return false;
+ var player = PacketEvents.getAPI().getPlayerManager().getUser(target);
+ if (player == null) return false;
+ WrapperPlayServerPlayerPositionAndLook packet = new WrapperPlayServerPlayerPositionAndLook(x,y,z,0,90, RelativeFlag.NONE.getMask(),0,false);
+ player.sendPacket(packet);
+ return true;
+ }
+}
diff --git a/src/main/java/me/trouper/sentinel/utils/PlayerUtils.java b/src/main/java/me/trouper/sentinel/utils/PlayerUtils.java
index 7e85210..b296277 100644
--- a/src/main/java/me/trouper/sentinel/utils/PlayerUtils.java
+++ b/src/main/java/me/trouper/sentinel/utils/PlayerUtils.java
@@ -30,17 +30,17 @@ public final class PlayerUtils {
return (sender instanceof Player p && isTrusted(p)) || sender instanceof ConsoleCommandSender;
}
- public static boolean playerCheck(CommandSender sender) {
+ public static boolean isConsoleCheck(CommandSender sender) {
if (!(sender instanceof Player)) {
- sender.sendMessage(Text.prefix(Sentinel.getInstance().getDirector().io.lang.permissions.playersOnly));
- return false;
+ Text.messageAny(Text.Pallet.ERROR,sender,Sentinel.getInstance().getDirector().io.lang.permissions.playersOnly);
+ return true;
}
- return true;
+ return false;
}
public static boolean checkPermission(CommandSender sender, String permission) {
if (sender instanceof ConsoleCommandSender || (sender instanceof Player p && p.hasPermission(permission))) return true;
- sender.sendMessage(Sentinel.getInstance().getDirector().io.lang.permissions.noPermission);
+ Text.messageAny(Text.Pallet.ERROR,sender,Sentinel.getInstance().getDirector().io.lang.permissions.noPermission);
return false;
}
@@ -63,19 +63,9 @@ public final class PlayerUtils {
getStaff().forEach(consumer);
}
public static void forEachTrusted(Consumer consumer) {
- getStaff().forEach(consumer);
+ getTrusted().forEach(consumer);
}
-
- public static void dmEachPlayer(Predicate condition, String dm) {
- forEachPlayer(p -> {
- if (condition.test(p)) p.sendMessage(dm);
- });
- }
-
- public static void dmEachPlayer(String dm) {
- forEachPlayer(p -> p.sendMessage(dm));
- }
-
+
public static void forEachSpecified(Iterable players, Consumer consumer) {
players.forEach(consumer);
}
diff --git a/src/main/java/me/trouper/sentinel/utils/ServerUtils.java b/src/main/java/me/trouper/sentinel/utils/ServerUtils.java
index 3d5ea20..c92929f 100644
--- a/src/main/java/me/trouper/sentinel/utils/ServerUtils.java
+++ b/src/main/java/me/trouper/sentinel/utils/ServerUtils.java
@@ -100,7 +100,6 @@ public final class ServerUtils {
URL url = new URL(apiUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-
connection.setRequestMethod("GET");
int responseCode = connection.getResponseCode();
diff --git a/src/main/java/me/trouper/sentinel/utils/Text.java b/src/main/java/me/trouper/sentinel/utils/Text.java
index e4f05cf..f7c45df 100644
--- a/src/main/java/me/trouper/sentinel/utils/Text.java
+++ b/src/main/java/me/trouper/sentinel/utils/Text.java
@@ -1,139 +1,222 @@
package me.trouper.sentinel.utils;
+import me.trouper.sentinel.server.Main;
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.ComponentLike;
+import net.kyori.adventure.text.TextReplacementConfig;
+import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import org.bukkit.Sound;
+import org.bukkit.SoundCategory;
+import org.bukkit.entity.Player;
-import me.trouper.sentinel.Sentinel;
-import org.bukkit.Location;
+import java.util.Arrays;
-import java.util.Locale;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
+public class Text implements Main {
-public final class Text {
+ /**
+ * Messages an audience applying pallet formating to the text and placeholders. Placeholders are zero-indexed and curly braced. {0}, {1}, {2}...
+ * @param pallet The colors to use for text and arguments.
+ * @param audience Any audience.
+ * @param text The message to format
+ * @param args Qualified placeholders to color.
+ */
+ public static void messageAny(Pallet pallet, Audience audience, String text, Object... args) {
+ message(pallet, audience, color(text), Arrays.stream(args).map(object -> Component.text(String.valueOf(object))).toArray(ComponentLike[]::new));
+ }
+
+ /**
+ * Messages an audience applying pallet formating to the component and placeholders. Placeholders are zero-indexed and curly braced. {0}, {1}, {2}...
+ * Preserves existing formatting like click events and hover events.
+ * @param pallet The colors to use for text and arguments.
+ * @param audience Any audience.
+ * @param text The component message to format
+ * @param args Qualified placeholders to color.
+ */
+ public static void message(Pallet pallet, Audience audience, ComponentLike text, ComponentLike... args) {
+ ComponentLike message = getMessage(pallet, text, args);
+ audience.sendMessage(message);
+ if (audience instanceof Player p) p.playSound(p.getLocation(), pallet.sound.sound, SoundCategory.VOICE, 10f, pallet.sound.pitch);
+ }
+
+ /**
+ * Gets the component form of a message, applying pallet formating to the text and placeholders. Placeholders are zero-indexed and curly braced. {0}, {1}, {2}...
+ * @param pallet The colors to use for text and arguments.
+ * @param text The message to format
+ * @param args Qualified placeholders to color.
+ * @return The final component, prefixed.
+ */
+ public static Component getMessageAny(Pallet pallet, String text, Object... args) {
+ return getMessage(pallet,color(text), Arrays.stream(args).map(arg -> color(String.valueOf(arg))).toArray(ComponentLike[]::new));
+ }
+
+ /**
+ * Gets the component form of a message, applying pallet formating to the component and placeholders. Placeholders are zero-indexed and curly braced. {0}, {1}, {2}...
+ * Preserves existing formatting like click events and hover events.
+ * @param pallet The colors to use for text and arguments.
+ * @param text The component message to format
+ * @param args Qualified placeholders to color.
+ * @return The final component, prefixed.
+ */
+ public static Component getMessage(Pallet pallet, ComponentLike text, ComponentLike... args) {
+ return prefix(format(pallet, text, args));
+ }
+
+ /**
+ * Prefixes a component with the plugin's configurable prefix.
+ * @param text The component to prefix
+ * @return A component with the prefix inserted before it. No spaces are added.
+ */
+ public static Component prefix(ComponentLike text) {
+ if (LegacyComponentSerializer.legacySection().serialize(text.asComponent()).startsWith(main.io().mainConfig.plugin.prefix)) return text.asComponent();
+ return color(main.io().mainConfig.plugin.prefix).append(text);
+ }
+
+ /**
+ * Wrapper for LegacyComponentSerializer, using ampersand (&) codes.
+ * @param msg the legacy text
+ * @return The deserialize component
+ */
+ public static Component color(String msg) {
+ if (msg.contains("§")) return LegacyComponentSerializer.legacySection().deserialize(msg);
+ return LegacyComponentSerializer.legacyAmpersand().deserialize(msg);
+ }
+
+ public static String legacyColor(String ampersands) {
+ return ampersands.replaceAll("&","§");
+ }
+
+ public static Component format(Pallet pallet, String text, Object... args) {
+ return format(pallet,Component.text(text), Arrays.stream(args).map(arg->Component.text(arg.toString())).toArray(Component[]::new));
+ }
+
+ public static Component format(Pallet pallet, ComponentLike text, ComponentLike... args) {
+ Component resultComponent = text.asComponent().color(pallet.mainText);
+
+ if (args == null || args.length == 0) {
+ return resultComponent;
+ }
+
+ for (int i = 0; i < args.length; i++) {
+ Component argument = args[i].asComponent();
+ if (shouldRecolor(argument.asComponent())) {
+ TextColor newColor = getArgColor(pallet, i);
+ argument = argument.color(newColor);
+ }
+
+ TextReplacementConfig replacementConfig = TextReplacementConfig.builder()
+ .matchLiteral("{" + i + "}")
+ .replacement(argument)
+ .build();
+
+ resultComponent = resultComponent.replaceText(replacementConfig);
+ }
+
+ return resultComponent;
+ }
+
+ /**
+ * A dummy method to determine if an argument component should have its color
+ * overridden by the pallet.
+ *
+ * @param component The component to check.
+ * @return Currently always returns true, indicating recoloring should occur.
+ */
+ private static boolean shouldRecolor(Component component) {
+ return true;
+ }
public static String removeColors(String input) {
- return input.replaceAll("((§|&)[0-9a-fklmnor])|((§|&)#(?:[0-9a-fA-F]{3}){1,2})", "");
+ if (input == null) return null;
+
+ input = input.replaceAll("(?i)[&§][0-9a-fk-or]", "");
+
+ input = input.replaceAll("(?i)[&§]#[a-f0-9]{6}", "");
+
+ input = input.replaceAll("(?i)§x(§[a-f0-9]){6}", "");
+
+ return input;
}
- public static String formatLoc(Location loc) {
- return "&7(&4" + loc.getBlockX() + "&7, &2" + loc.getBlockY() + "&7, &1" + loc.getBlockZ() + "&7)";
+ public static Component removeColors(ComponentLike input) {
+ if (input == null) return Component.text("");
+
+ String plainText = PlainTextComponentSerializer.plainText().serialize(input.asComponent());
+
+ return Component.text(plainText);
}
- public static String regexHighlighter(String input, String regex, String startString, String endString) {
- Pattern pattern = Pattern.compile(regex);
-
- Matcher matcher = pattern.matcher(input);
-
- StringBuffer result = new StringBuffer();
-
- while (matcher.find()) {
- matcher.appendReplacement(result, startString + matcher.group() + endString);
- }
- matcher.appendTail(result);
-
- return result.toString();
+ /**
+ * Gets the appropriate argument color based on the argument index.
+ */
+ private static TextColor getArgColor(Pallet pallet, int argIndex) {
+ return switch (argIndex) {
+ case 1 -> pallet.arg2;
+ case 2 -> pallet.arg3;
+ default -> pallet.argDefault;
+ };
}
- public static final char SECTION_SYMBOL = (char)167;
+ public enum Pallet {
+ ERROR(
+ TextColor.color(0xD3A6A4),
+ TextColor.color(0xFFF1AE),
+ TextColor.color(0xFF796D),
+ TextColor.color(0xC62828),
+ new SoundData(Sound.BLOCK_NOTE_BLOCK_BASS, 1)
+ ),
+ WARNING(
+ TextColor.color(0xFFF3CD),
+ TextColor.color(0xFFF9F5),
+ TextColor.color(0xFFD54F),
+ TextColor.color(0xFFA000),
+ new SoundData(Sound.BLOCK_NOTE_BLOCK_BIT, 0.5F)
+ ),
+ INFO(
+ TextColor.color(0xBBDEFB),
+ TextColor.color(0xD2D0EA),
+ TextColor.color(0x64B5F6),
+ TextColor.color(0x1976D2),
+ new SoundData(Sound.BLOCK_NOTE_BLOCK_CHIME, 0.7F)
+ ),
+ SUCCESS(
+ TextColor.color(0xCDFFC7),
+ TextColor.color(0xFFFFFF),
+ TextColor.color(0xB0FFE3),
+ TextColor.color(0x63CD83),
+ new SoundData(Sound.BLOCK_NOTE_BLOCK_PLING, 1.5F)
+ ),
+ NEUTRAL(
+ TextColor.color(0xD3D3D3),
+ TextColor.color(0xFFFFFF),
+ TextColor.color(0xFFB3F8),
+ TextColor.color(0xE280FF),
+ new SoundData(Sound.BLOCK_NOTE_BLOCK_BELL, 1)
+ ),
+ LOCATION(
+ TextColor.color(0xAAAAAA),
+ TextColor.color(0xFFB0C1),
+ TextColor.color(0xB6F5B6),
+ TextColor.color(0xB0C1FF),
+ new SoundData(Sound.UI_HUD_BUBBLE_POP, 2)
+ );
- public static String color(String msg) {
- return msg.replace('&', SECTION_SYMBOL);
- }
+ private final TextColor mainText;
+ private final TextColor argDefault;
+ private final TextColor arg2;
+ private final TextColor arg3;
+ private final SoundData sound;
- public static String prefix(String text) {
- String prefix = Sentinel.getInstance().getDirector().io.mainConfig.plugin.prefix;
- return color(prefix + text);
- }
-
- public static String removeFirstColor(String input) {
- if (input.startsWith("\u00a7")) {
- if (input.length() > 2) {
- return input.substring(2);
- } else {
- return "";
- }
- } else {
- return input;
+ Pallet(TextColor mainText, TextColor argDefault, TextColor arg2, TextColor arg3, SoundData sound) {
+ this.mainText = mainText;
+ this.argDefault = argDefault;
+ this.arg2 = arg2;
+ this.arg3 = arg3;
+ this.sound = sound;
}
}
- public static String replaceRepeatingLetters(String input) {
- if (input == null || input.isEmpty()) {
- return input;
- }
-
- StringBuilder simplifiedText = new StringBuilder();
- char currentChar = input.charAt(0);
- int count = 1;
-
- for (int i = 1; i < input.length(); i++) {
- char nextChar = input.charAt(i);
-
- if (Character.toLowerCase(nextChar) == Character.toLowerCase(currentChar)) {
- count++;
- } else {
- simplifiedText.append(currentChar);
-
- if (count > 1) {
- simplifiedText.append(currentChar);
- }
-
- currentChar = nextChar;
- count = 1;
- }
- }
-
- simplifiedText.append(currentChar);
-
- if (count > 1) {
- simplifiedText.append(currentChar);
- }
-
- return simplifiedText.toString();
- }
-
- public static String fromLeetString(String s) {
- Map dictionary = Sentinel.getInstance().getDirector().io.advConfig.leetPatterns;
- String msg = s;
-
- for (String key : dictionary.keySet()) {
- if (!s.contains(key)) continue;
- try {
- if (key.equals("$")) {
- msg = msg.replaceAll("\\$", "s");
- }
- else {
- msg = msg.replaceAll(key, dictionary.get(key));
- }
- }
- catch (PatternSyntaxException ex) {
- String regex = "[" + key + "]";
- msg = msg.replaceAll(regex, dictionary.get(key));
- }
- }
- return msg;
- }
-
- public static String cleanName(String type) {
- return type.replaceAll("_"," ").toUpperCase(Locale.US);
- }
-
- public static String formatMillis(long millis) {
- long days = millis / 86400000L;
- millis %= 86400000L;
- long hours = millis / 3600000L;
- millis %= 3600000L;
- long minutes = millis / 60000L;
- millis %= 60000L;
- long seconds = millis / 1000L;
- millis %= 1000L;
- StringBuilder sb = new StringBuilder();
- if (days > 0) sb.append(days).append("d ");
- if (hours > 0) sb.append(hours).append("hr ");
- if (minutes > 0) sb.append(minutes).append("min ");
- if (seconds > 0) sb.append(seconds).append("sec ");
- if (millis > 0) sb.append(millis).append("ms");
- return sb.toString().trim();
- }
-}
+ public record SoundData(Sound sound, float pitch) {}
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/utils/display/BlockDisplayRaytracer.java b/src/main/java/me/trouper/sentinel/utils/display/BlockDisplayRaytracer.java
index c047a06..a1d4c19 100644
--- a/src/main/java/me/trouper/sentinel/utils/display/BlockDisplayRaytracer.java
+++ b/src/main/java/me/trouper/sentinel/utils/display/BlockDisplayRaytracer.java
@@ -7,12 +7,14 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.BlockDisplay;
import org.bukkit.entity.Display;
+import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Transformation;
import org.bukkit.util.Vector;
import org.joml.AxisAngle4f;
import org.joml.Vector3f;
+import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@@ -20,6 +22,11 @@ public class BlockDisplayRaytracer {
private static final Sentinel system = Sentinel.getInstance();
+ public static void cleanup(World world) {
+ List entities = new ArrayList<>(world.getEntities().stream().filter(entity -> entity.getScoreboardTags().contains("./Sentinel/ Block Display")).toList());
+ entities.forEach(Entity::remove);
+ }
+
public static void outline(Material display, Location location, long stayTime, List viewers) {
outline(display, location, 0.05, stayTime, viewers);
}
diff --git a/src/main/java/me/trouper/sentinel/utils/DisplayUtils.java b/src/main/java/me/trouper/sentinel/utils/display/DisplayUtils.java
similarity index 98%
rename from src/main/java/me/trouper/sentinel/utils/DisplayUtils.java
rename to src/main/java/me/trouper/sentinel/utils/display/DisplayUtils.java
index 13aa128..8514849 100644
--- a/src/main/java/me/trouper/sentinel/utils/DisplayUtils.java
+++ b/src/main/java/me/trouper/sentinel/utils/display/DisplayUtils.java
@@ -1,9 +1,8 @@
-package me.trouper.sentinel.utils;
+package me.trouper.sentinel.utils.display;
import io.github.itzispyder.pdk.utils.misc.Randomizer;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.Selection;
-import me.trouper.sentinel.utils.display.BlockDisplayRaytracer;
+import me.trouper.sentinel.data.types.Selection;
import org.bukkit.*;
import org.bukkit.entity.Player;
diff --git a/src/main/java/me/trouper/sentinel/utils/trees/ConsoleFormatter.java b/src/main/java/me/trouper/sentinel/utils/trees/ConsoleFormatter.java
index 6c3f09e..2340443 100644
--- a/src/main/java/me/trouper/sentinel/utils/trees/ConsoleFormatter.java
+++ b/src/main/java/me/trouper/sentinel/utils/trees/ConsoleFormatter.java
@@ -1,7 +1,11 @@
package me.trouper.sentinel.utils.trees;
-import me.trouper.sentinel.utils.Text;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import java.util.Map;
public class ConsoleFormatter {
@@ -12,34 +16,36 @@ public class ConsoleFormatter {
return sb.toString();
}
+ public static Component formatComponent(Node node) {
+ return formatNodeComponent(node, 0);
+ }
+
private static void formatNode(StringBuilder sb, Node node, int level) {
if (level == 0) {
- sb.append("]==-- ").append(node.title).append(" --==[\n");
+ sb.append("]==-- ")
+ .append(componentToPlainText(node.title))
+ .append(" --==[\n");
} else {
- sb.append(node.title).append("\n");
+ sb.append(componentToPlainText(node.title)).append("\n");
}
- node.texts = node.texts.reversed();
- for (String text : node.texts) {
- text = Text.removeColors(text);
- text = text.replace(""," > ");
- text = text.replace(""," < ");
+ // Reverse the texts list for display
+ List reversedTexts = new ArrayList<>(node.texts);
+ Collections.reverse(reversedTexts);
+
+ for (Component text : reversedTexts) {
+ String plainText = processComponentForConsole(text);
if (level == 0) {
- sb.append(text).append("\n");
+ sb.append(plainText).append("\n");
} else {
- sb.append(" ➥ ").append(text).append("\n");
+ sb.append(" ➥ ").append(plainText).append("\n");
}
}
- for (Map.Entry entry : node.values.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = Text.removeColors(key);
- value = Text.removeColors(value);
- key = key.replace(""," > ");
- key = key.replace(""," < ");
- value = value.replace(""," > ");
- value = value.replace(""," < ");
+ for (Map.Entry entry : node.values.entrySet()) {
+ String key = processComponentForConsole(entry.getKey());
+ String value = processComponentForConsole(entry.getValue());
+
if (level == 0) {
sb.append(key).append(": ").append(value).append("\n");
} else {
@@ -47,19 +53,14 @@ public class ConsoleFormatter {
}
}
- for (Map.Entry entry : node.fields.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = Text.removeColors(key);
- value = Text.removeColors(value);
- key = key.replace(""," > ");
- key = key.replace(""," < ");
- value = value.replace(""," > ");
- value = value.replace(""," < ");
+ for (Map.Entry entry : node.fields.entrySet()) {
+ String key = processComponentForConsole(entry.getKey());
+ String value = processComponentForConsole(entry.getValue());
+
if (level == 0) {
sb.append(key).append(":\n ").append(value).append("\n");
} else {
- sb.append(" ➥ ").append(key).append(":\n ").append(value).append("\n");
+ sb.append(" ➥ ").append(key).append(":\n ").append(value).append("\n");
}
}
@@ -67,4 +68,93 @@ public class ConsoleFormatter {
formatNode(sb, child, level + 1);
}
}
-}
+
+ private static Component formatNodeComponent(Node node, int level) {
+ Component result = Component.empty();
+
+ if (level == 0) {
+ result = result.append(Component.text("]==-- "))
+ .append(node.title)
+ .append(Component.text(" --==["))
+ .append(Component.newline());
+ } else {
+ result = result.append(node.title).append(Component.newline());
+ }
+
+ List reversedTexts = new ArrayList<>(node.texts);
+ Collections.reverse(reversedTexts);
+
+ for (Component text : reversedTexts) {
+ Component processedText = processComponentForConsoleComponent(text);
+ if (level == 0) {
+ result = result.append(processedText).append(Component.newline());
+ } else {
+ result = result.append(Component.text(" ➥ "))
+ .append(processedText)
+ .append(Component.newline());
+ }
+ }
+
+ for (Map.Entry entry : node.values.entrySet()) {
+ Component key = processComponentForConsoleComponent(entry.getKey());
+ Component value = processComponentForConsoleComponent(entry.getValue());
+
+ if (level == 0) {
+ result = result.append(key)
+ .append(Component.text(": "))
+ .append(value)
+ .append(Component.newline());
+ } else {
+ result = result.append(Component.text(" ➥ "))
+ .append(key)
+ .append(Component.text(": "))
+ .append(value)
+ .append(Component.newline());
+ }
+ }
+
+ for (Map.Entry entry : node.fields.entrySet()) {
+ Component key = processComponentForConsoleComponent(entry.getKey());
+ Component value = processComponentForConsoleComponent(entry.getValue());
+
+ if (level == 0) {
+ result = result.append(key)
+ .append(Component.text(":"))
+ .append(Component.newline())
+ .append(Component.text(" "))
+ .append(value)
+ .append(Component.newline());
+ } else {
+ result = result.append(Component.text(" ➥ "))
+ .append(key)
+ .append(Component.text(":"))
+ .append(Component.newline())
+ .append(Component.text(" "))
+ .append(value)
+ .append(Component.newline());
+ }
+ }
+
+ for (Node child : node.children) {
+ result = result.append(formatNodeComponent(child, level + 1));
+ }
+
+ return result;
+ }
+
+ private static String componentToPlainText(Component component) {
+ return PlainTextComponentSerializer.plainText().serialize(component);
+ }
+
+ private static String processComponentForConsole(Component component) {
+ String text = componentToPlainText(component);
+ text = text.replace("█HS█", " > ");
+ text = text.replace("█HE█", " < ");
+ return text;
+ }
+
+ private static Component processComponentForConsoleComponent(Component component) {
+ // TODO: Parse console components
+ return component;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/utils/trees/EmbedFormatter.java b/src/main/java/me/trouper/sentinel/utils/trees/EmbedFormatter.java
index 4619080..4f32f0e 100644
--- a/src/main/java/me/trouper/sentinel/utils/trees/EmbedFormatter.java
+++ b/src/main/java/me/trouper/sentinel/utils/trees/EmbedFormatter.java
@@ -4,8 +4,9 @@ import io.github.itzispyder.pdk.utils.SchedulerUtils;
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
import io.github.itzispyder.pdk.utils.discord.DiscordWebhook;
import me.trouper.sentinel.Sentinel;
-import me.trouper.sentinel.data.misc.Emojis;
-import me.trouper.sentinel.utils.Text;
+import me.trouper.sentinel.data.types.Emojis;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import java.io.IOException;
import java.util.Map;
@@ -14,22 +15,28 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class EmbedFormatter {
public static boolean sendEmbed(DiscordEmbed embed) {
- return sendEmbed(embed,Sentinel.getInstance().getDirector().io.mainConfig.plugin.webhook);
+ return sendEmbed(embed, Sentinel.getInstance().getDirector().io.mainConfig.plugin.webhook);
}
public static boolean sendEmbed(DiscordEmbed embed, String spec) {
- DiscordWebhook webhook = new DiscordWebhook("Sentinel Anti-Nuke Webhook Logger", "https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/i9vsvqjg.png","", false, embed);
+ DiscordWebhook webhook = new DiscordWebhook(
+ "Sentinel Anti-Nuke Webhook Logger",
+ "https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/i9vsvqjg.png",
+ "",
+ false,
+ embed
+ );
+
AtomicBoolean success = new AtomicBoolean(false);
- SchedulerUtils.later(0,()->{
+ SchedulerUtils.later(0, () -> {
try {
webhook.send(spec);
+ success.set(true);
} catch (IOException e) {
Sentinel.getInstance().getLogger().info("Discord declined the web request: " + e.getMessage());
Sentinel.getInstance().getLogger().info("Please insure your webhook URL is correct, otherwise nothing will be logged to discord.");
success.set(false);
- return;
}
- success.set(true);
});
return success.get();
}
@@ -38,65 +45,88 @@ public class EmbedFormatter {
DiscordEmbed.Builder eb = new DiscordEmbed.Builder();
StringBuilder desc = new StringBuilder();
- formatNode(eb, node, desc,0);
+ formatNode(eb, node, desc, 0);
eb.color(0xFFAB4D);
return eb.desc(desc.toString()).build();
}
private static void formatNode(DiscordEmbed.Builder eb, Node node, StringBuilder desc, int level) {
- eb.author("Sentinel | Anti-Nuke","https://trouper.me/sentinel",null);
+ eb.author("Sentinel | Anti-Nuke", "https://trouper.me/sentinel", null);
eb.thumbnail("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/v5rxlx0d.png");
+
if (level == 0) {
- eb.title("Incoming from server: %s".formatted(Sentinel.getInstance().getDirector().io.mainConfig.plugin.identifier));
+ eb.title("Incoming from server: %s".formatted(
+ Sentinel.getInstance().getDirector().io.mainConfig.plugin.identifier));
} else {
- desc.repeat(Emojis.space,level - 1).append("**").append(Text.removeColors(node.title)).append("**\n");
+ desc.repeat(Emojis.space, level - 1)
+ .append("**")
+ .append(componentToPlainText(node.title))
+ .append("**\n");
}
- for (String text : node.texts) {
- text = Text.removeColors(text);
- text = text.replace(""," > ");
- text = text.replace(""," < ");
+ // Process text lines
+ for (Component text : node.texts) {
+ String plainText = processComponentForDiscord(text);
if (level == 0) {
- desc.append(text).append("\n");
+ desc.append(plainText).append("\n");
} else {
- desc.repeat(Emojis.space,level - 1).append(Emojis.rightSort).append(text).append("\n");
+ desc.repeat(Emojis.space, level - 1)
+ .append(Emojis.rightSort)
+ .append(plainText)
+ .append("\n");
}
}
- for (Map.Entry entry : node.values.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = Text.removeColors(key);
- value = Text.removeColors(value);
- key = key.replace(""," > ");
- key = key.replace(""," < ");
- value = value.replace(""," > ");
- value = value.replace(""," < ");
+ // Process key-value pairs
+ for (Map.Entry entry : node.values.entrySet()) {
+ String key = processComponentForDiscord(entry.getKey());
+ String value = processComponentForDiscord(entry.getValue());
+
if (level == 0) {
desc.append(key).append(": `").append(value).append("`\n");
} else {
- desc.repeat(Emojis.space,level - 1).append(Emojis.rightSort).append(key).append(": `").append(value).append("`\n");
+ desc.repeat(Emojis.space, level - 1)
+ .append(Emojis.rightSort)
+ .append(key)
+ .append(": `")
+ .append(value)
+ .append("`\n");
}
}
- for (Map.Entry entry : node.fields.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = Text.removeColors(key);
- value = Text.removeColors(value);
- key = key.replace(""," > ");
- key = key.replace(""," < ");
- value = value.replace(""," > ");
- value = value.replace(""," < ");
+ // Process fields
+ for (Map.Entry entry : node.fields.entrySet()) {
+ String key = processComponentForDiscord(entry.getKey());
+ String value = processComponentForDiscord(entry.getValue());
+
if (level == 0) {
desc.append("**").append(key).append("**:\n `").append(value).append("`\n");
} else {
- desc.repeat(Emojis.space,level - 1).append(Emojis.rightArrow).append("**").append(key).append("**:\n `").append(value).append("`\n");
+ desc.repeat(Emojis.space, level - 1)
+ .append(Emojis.rightArrow)
+ .append("**")
+ .append(key)
+ .append("**:\n `")
+ .append(value)
+ .append("`\n");
}
}
+ // Process children
for (Node child : node.children) {
- formatNode(eb, child, desc,level + 1);
+ formatNode(eb, child, desc, level + 1);
}
}
-}
+
+ private static String componentToPlainText(Component component) {
+ return PlainTextComponentSerializer.plainText().serialize(component);
+ }
+
+ private static String processComponentForDiscord(Component component) {
+ String text = componentToPlainText(component);
+
+ text = text.replace("█HS█", " **");
+ text = text.replace("█HE█", "** ");
+ return text;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/utils/trees/HoverFormatter.java b/src/main/java/me/trouper/sentinel/utils/trees/HoverFormatter.java
index dd5a686..b897817 100644
--- a/src/main/java/me/trouper/sentinel/utils/trees/HoverFormatter.java
+++ b/src/main/java/me/trouper/sentinel/utils/trees/HoverFormatter.java
@@ -1,66 +1,107 @@
package me.trouper.sentinel.utils.trees;
-import me.trouper.sentinel.utils.Text;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import java.util.Map;
public class HoverFormatter {
- public static String format(Node node) {
- StringBuilder sb = new StringBuilder();
- formatNode(sb, node, 0);
- return Text.color(sb.toString());
+ public static Component format(Node node) {
+ return formatNode(node, 0);
}
- private static void formatNode(StringBuilder sb, Node node, int level) {
+ public static String formatLegacy(Node node) {
+ Component component = format(node);
+ return LegacyComponentSerializer.legacyAmpersand().serialize(component);
+ }
+
+ private static Component formatNode(Node node, int level) {
+ Component result = Component.empty();
+
if (level == 0) {
- //sb.append("B3B3B]==C8C8C-A7A7A7- &6&l").append(node.title).append("&r A7A7A7-C8C8C-==B3B3B[\n");
- sb.append("&8]==-- &6&l").append(node.title).append("&r &8--==[\n&r");
+ Component titleLine = Component.text("]==-- ")
+ .color(NamedTextColor.DARK_GRAY)
+ .append(node.title.color(NamedTextColor.GOLD).decorate(TextDecoration.BOLD))
+ .append(Component.text(" --==[").color(NamedTextColor.DARK_GRAY))
+ .append(Component.newline());
+ result = result.append(titleLine);
} else {
- sb.append("&f&l").append(node.title).append("\n");
+ Component childTitle = node.title
+ .color(NamedTextColor.WHITE)
+ .decorate(TextDecoration.BOLD)
+ .append(Component.newline());
+ result = result.append(childTitle);
}
- for (String text : node.texts) {
- text = text.replace("","&e&n");
- text = text.replace("","&r&b");
+ for (Component text : node.texts) {
+ Component processedText = processHighlightTags(text);
if (level == 0) {
- sb.append("&7").append(text).append("\n");
+ result = result.append(processedText.color(NamedTextColor.GRAY))
+ .append(Component.newline());
} else {
- sb.append(" &8&l➥&r &7").append(text).append("\n");
+ result = result.append(Component.text(" ➥ ")
+ .color(NamedTextColor.DARK_GRAY)
+ .decorate(TextDecoration.BOLD))
+ .append(processedText.color(NamedTextColor.GRAY))
+ .append(Component.newline());
}
}
- for (Map.Entry entry : node.values.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = key.replace("","&e&n");
- key = key.replace("","&r&b");
- value = value.replace("","&e&n");
- value = value.replace("","&r&b");
+ for (Map.Entry entry : node.values.entrySet()) {
+ Component key = processHighlightTags(entry.getKey());
+ Component value = processHighlightTags(entry.getValue());
+
if (level == 0) {
- sb.append("&7").append(key).append("&8: &b").append(value).append("\n&r");
+ result = result.append(key.color(NamedTextColor.GRAY))
+ .append(Component.text(": ").color(NamedTextColor.DARK_GRAY))
+ .append(value.color(NamedTextColor.AQUA))
+ .append(Component.newline());
} else {
- sb.append(" &8&l➥&r &7").append(key).append("&8: &b").append(value).append("\n&r");
+ result = result.append(Component.text(" ➥ ")
+ .color(NamedTextColor.DARK_GRAY)
+ .decorate(TextDecoration.BOLD))
+ .append(key.color(NamedTextColor.GRAY))
+ .append(Component.text(": ").color(NamedTextColor.DARK_GRAY))
+ .append(value.color(NamedTextColor.AQUA))
+ .append(Component.newline());
}
}
- for (Map.Entry entry : node.fields.entrySet()) {
- String key = entry.getKey();
- String value = entry.getValue();
- key = key.replace("","&e&n");
- key = key.replace("","&r&b");
- value = value.replace("","&e&n");
- value = value.replace("","&r&b");
+ for (Map.Entry entry : node.fields.entrySet()) {
+ Component key = processHighlightTags(entry.getKey());
+ Component value = processHighlightTags(entry.getValue());
+
if (level == 0) {
- sb.append("&7").append(key).append("&8:\n&b ").append(value).append("\n&r");
+ result = result.append(key.color(NamedTextColor.GRAY))
+ .append(Component.text(":").color(NamedTextColor.DARK_GRAY))
+ .append(Component.newline())
+ .append(Component.text(" ").append(value.color(NamedTextColor.AQUA)))
+ .append(Component.newline());
} else {
- sb.append(" &8&l➥&r &7").append(key).append("&8:\n &b ").append(value).append("\n&r");
+ result = result.append(Component.text(" ➥ ")
+ .color(NamedTextColor.DARK_GRAY)
+ .decorate(TextDecoration.BOLD))
+ .append(key.color(NamedTextColor.GRAY))
+ .append(Component.text(":").color(NamedTextColor.DARK_GRAY))
+ .append(Component.newline())
+ .append(Component.text(" ")
+ .append(value.color(NamedTextColor.AQUA)))
+ .append(Component.newline());
}
}
for (Node child : node.children) {
- formatNode(sb, child, level + 1);
+ result = result.append(formatNode(child, level + 1));
}
- }
-}
+ return result;
+ }
+
+ private static Component processHighlightTags(Component component) {
+ // TODO: Process legacy highlight tags
+ return component;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/me/trouper/sentinel/utils/trees/Node.java b/src/main/java/me/trouper/sentinel/utils/trees/Node.java
index f6bd5a8..d54d7a1 100644
--- a/src/main/java/me/trouper/sentinel/utils/trees/Node.java
+++ b/src/main/java/me/trouper/sentinel/utils/trees/Node.java
@@ -1,18 +1,22 @@
package me.trouper.sentinel.utils.trees;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextDecoration;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Node {
- public String title;
- public List texts;
- public Map values;
- public Map fields;
+ public Component title;
+ public List texts;
+ public Map values;
+ public Map fields;
public List children;
- public Node(String title) {
+ public Node(Component title) {
this.title = title;
this.texts = new ArrayList<>();
this.values = new HashMap<>();
@@ -20,20 +24,68 @@ public class Node {
this.children = new ArrayList<>();
}
- public void addTextLine(String text) {
+ public Node(String title) {
+ this(Component.text(title));
+ }
+
+ public Node() {
+ this(Component.text("Sentinel"));
+ }
+
+ public void addTextLine(Component text) {
this.texts.add(text);
}
- public void addKeyValue(String name, String value) {
- this.values.put(name, value);
+ public void addTextLine(String text) {
+ this.texts.add(Component.text(text));
+ }
+
+ public void addKeyValue(Component key, Component value) {
+ this.values.put(key, value);
+ }
+
+ public void addKeyValue(String key, String value) {
+ this.values.put(Component.text(key), Component.text(value));
+ }
+
+ public void addField(Component title, Component value) {
+ this.fields.put(title, value);
}
public void addField(String title, String value) {
- this.fields.put(title,value);
+ this.fields.put(Component.text(title), Component.text(value));
}
public void addChild(Node child) {
this.children.add(child);
}
-}
+ public static Component createHighlightedText(String text) {
+ return Component.text(text)
+ .color(NamedTextColor.YELLOW)
+ .decorate(TextDecoration.UNDERLINED);
+ }
+
+ public static Component parseLegacyText(String text) {
+ if (text.contains("█HS█") || text.contains("█HE█")) {
+ String[] parts = text.split("(?=█HS█)|(?<=█HE█)");
+ Component result = Component.empty();
+
+ for (String part : parts) {
+ if (part.startsWith("█HS█") && part.endsWith("█HE█")) {
+ part = part.substring(4, part.length() - 4);
+ Component segment = Component.text(part)
+ .color(NamedTextColor.YELLOW)
+ .decorate(TextDecoration.UNDERLINED);
+ result = result.append(segment);
+ continue;
+ }
+
+ result = result.append(Component.text(part));
+ }
+ return result;
+ }
+
+ return Component.text(text);
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index d8ad5ab..006632a 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -7,15 +7,12 @@ prefix: 'Sentinel'
description: Detect, Block, and Ban players who attempt to grief your server.
website: https://thetrouper.github.io/
softdepend:
- - ProtocolLib
- - ProtocolSupport
- ViaVersion
- ViaBackwards
- ViaRewind
- Geyser-Spigot
- NoChatReports
- - NoteBlockAPI
-load: POSTWORLD
+load: STARTUP
permissions:
sentinel.admin:
description: Allows access to all Sentinel admin commands.
@@ -31,16 +28,16 @@ permissions:
sentinel.false-positive: true
sentinel.false-positive:
description: Allows the user to manage false positives.
- default: false
+ default: op
children:
sentinel.false-positive.add: true
sentinel.false-positive.remove: true
sentinel.false-positive.add:
description: Allows the user to add a false positive.
- default: false
+ default: op
sentinel.false-positive.remove:
description: Allows the user to remove a false positive.
- default: false
+ default: op
sentinel.debug:
description: Allows the user to toggle debug mode.
default: op
@@ -49,10 +46,10 @@ permissions:
default: op
sentinel.commandblock:
description: Allows the user to manage command blocks.
- default: false
+ default: op
sentinel.socialspy:
description: Allows the user to spy on social interactions.
- default: false
+ default: op
sentinel.callbacks:
description: Allows access to all Sentinel callback commands.
default: op
@@ -60,7 +57,7 @@ permissions:
sentinel.callbacks.fpreport: true
sentinel.callbacks.fpreport:
description: Allows the user to report false positives.
- default: false
+ default: op
sentinel.message:
description: Allows the user to send messages.
default: true
@@ -69,7 +66,7 @@ permissions:
default: true
sentinel.chatfilter:
description: Parent permission for all chat-related features.
- default: false
+ default: op
children:
sentinel.chatfilter.profanity: true
sentinel.chatfilter.spam: true
@@ -77,52 +74,52 @@ permissions:
sentinel.chatfilter.url: true
sentinel.chatfilter.profanity:
description: Parent permission for profanity filter features.
- default: false
+ default: op
children:
sentinel.chatfilter.profanity.view: true
sentinel.chatfilter.profanity.bypass: true
sentinel.chatfilter.profanity.view:
description: Allows the user to view profanity filter logs.
- default: false
+ default: op
sentinel.chatfilter.profanity.bypass:
description: Allows the user to bypass the profanity filter.
- default: false
+ default: op
sentinel.chatfilter.spam:
description: Parent permission for spam filter features.
- default: false
+ default: op
children:
sentinel.chatfilter.spam.view: true
sentinel.chatfilter.spam.bypass: true
sentinel.chatfilter.spam.view:
description: Allows the user to view spam filter logs.
- default: false
+ default: op
sentinel.chatfilter.spam.bypass:
description: Allows the user to bypass the spam filter.
- default: false
+ default: op
sentinel.chatfilter.unicode:
description: Parent permission for unicode filter features.
- default: false
+ default: op
children:
sentinel.chatfilter.unicode.view: true
sentinel.chatfilter.unicode.bypass: true
sentinel.chatfilter.unicode.view:
description: Allows the user to view unicode filter logs.
- default: false
+ default: op
sentinel.chatfilter.unicode.bypass:
description: Allows the user to bypass the unicode filter.
- default: false
+ default: op
sentinel.chatfilter.url:
description: Parent permission for URL filter features.
- default: false
+ default: op
children:
sentinel.chatfilter.url.view: true
sentinel.chatfilter.url.bypass: true
sentinel.chatfilter.url.view:
description: Allows the user to view URL filter logs.
- default: false
+ default: op
sentinel.chatfilter.url.bypass:
description: Allows the user to bypass the URL filter.
- default: false
+ default: op
commands:
sentinel:
description: Main command for Sentinel.
diff --git a/src/main/resources/songs/Never Gonna Give You Up.nbs b/src/main/resources/songs/Never Gonna Give You Up.nbs
deleted file mode 100644
index 9c1300f..0000000
Binary files a/src/main/resources/songs/Never Gonna Give You Up.nbs and /dev/null differ