From 111649f29654f0e94d58e5eb7cef4967b96dcebe Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:50:08 -0500 Subject: [PATCH 01/31] Migrates to Gradle --- .gitignore | 5 + build.gradle.kts | 62 +++++ gradle.properties | 1 + gradlew | 248 ++++++++++++++++++ gradlew.bat | 93 +++++++ {bin => libs}/ThemisAPI.jar | Bin pom.xml | 117 --------- settings.gradle.kts | 1 + .../xyz/earthcow/themistodiscord/Message.java | 1 - src/main/resources/plugin.yml | 4 +- 10 files changed, 412 insertions(+), 120 deletions(-) create mode 100644 build.gradle.kts create mode 100644 gradle.properties create mode 100755 gradlew create mode 100644 gradlew.bat rename {bin => libs}/ThemisAPI.jar (100%) delete mode 100644 pom.xml create mode 100644 settings.gradle.kts diff --git a/.gitignore b/.gitignore index 2df6176..0595f8c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,10 @@ out/ # Maven target/ +# Gradle +.gradle/ +gradle/ +build/ + # Common working directory run/ diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..fb1386c --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,62 @@ +plugins { + `java-library` + // Shade plugin + id("com.gradleup.shadow") version "9.3.0" +} + +repositories { + mavenCentral() + // Spigot + maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") + // Jitpack + maven("https://jitpack.io") + // Floodgate / Geyser + maven("https://repo.opencollab.dev/main/") +} + +dependencies { + implementation(libs.dev.dejvokep.boosted.yaml) + implementation(libs.com.github.earthcow.javadiscordwebhook) + + compileOnly(files("libs/ThemisAPI.jar")) + compileOnly(libs.org.spigotmc.spigot.api) + compileOnly(libs.org.jetbrains.annotations) + compileOnly(libs.org.geysermc.floodgate.api) +} + +group = "xyz.earthcow" +version = "0.3.0" + +tasks.withType() { + options.encoding = "UTF-8" +} + +tasks.withType() { + options.encoding = "UTF-8" +} + +tasks.processResources { + val props = mapOf( + "name" to project.name, + "version" to project.version, + ) + + inputs.properties(props) + + filesMatching("plugin.yml") { + expand(props) + } +} + +tasks.shadowJar { + // Overwrite default jar + archiveClassifier.set("") + // Relocate shaded dependencies to internal libs directory + relocate("dev.dejvokep.boostedyaml", "xyz.earthcow.themistodiscord.libs.boostedyaml") + // Exclude annotation packages from the uber jar file + exclude("org/intellij/**", "org/jetbrains/**") +} + +tasks.build { + dependsOn(tasks.shadowJar) +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..5ad6974 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +org.gradle.configuration-cache=true diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..adff685 --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e509b2d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,93 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/bin/ThemisAPI.jar b/libs/ThemisAPI.jar similarity index 100% rename from bin/ThemisAPI.jar rename to libs/ThemisAPI.jar diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 4b059cb..0000000 --- a/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - 4.0.0 - - xyz.earthcow - ThemisToDiscord - 0.3.0 - jar - - ThemisToDiscord - - - 1.8 - UTF-8 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-shade-plugin - 3.6.0 - - - - dev.dejvokep.boostedyaml - xyz.earthcow.libs - - - - - - package - - shade - - - false - - - - - - - - src/main/resources - true - - - - - - - spigotmc-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots/ - - - jitpack.io - https://jitpack.io - - - - opencollab-snapshot - https://repo.opencollab.dev/main/ - - - - - - org.spigotmc - spigot-api - 1.17-R0.1-SNAPSHOT - provided - - - org.jetbrains - annotations - 24.1.0 - provided - - - - com.gmail.olexorus.themis.api - ThemisAPI - 0.15.3 - system - ${project.basedir}/bin/ThemisAPI.jar - - - org.geysermc.floodgate - api - 2.2.4-SNAPSHOT - provided - - - dev.dejvokep - boosted-yaml - 1.3.7 - - - com.github.EarthCow - JavaDiscordWebhook - master-SNAPSHOT - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..a371f28 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "ThemisToDiscord" diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index e5113bb..589cbc1 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -7,7 +7,6 @@ import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.slf4j.helpers.Util; import xyz.earthcow.discordwebhook.DiscordWebhook; import java.awt.*; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 2500bbc..7ea0d46 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ -name: ThemisToDiscord -version: '${project.version}' +name: '${name}' +version: '${version}' main: xyz.earthcow.themistodiscord.ThemisToDiscord api-version: '1.17' depend: From a160b158f10f6b8a14d787366d7f960b7837333c Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:53:21 -0500 Subject: [PATCH 02/31] Changes build workflow to use gradle --- .github/workflows/build.yml | 9 ++++++--- gradlew.bat | 0 2 files changed, 6 insertions(+), 3 deletions(-) mode change 100644 => 100755 gradlew.bat diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 437e0da..7676dac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# Builds a Java project with Maven +# Builds a Java project with Gradle name: Build on: @@ -22,5 +22,8 @@ jobs: distribution: 'temurin' cache: maven - - name: Build with Maven - run: mvn -B package + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: ./gradlew build diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 From dff76c6e1e78ec7eec7e310f86f1268f21ee4131 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:56:06 -0500 Subject: [PATCH 03/31] Fixes build workflow --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7676dac..bda91df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: with: java-version: '17' distribution: 'temurin' - cache: maven - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 From 7df4ed49388de69154b0d33e2c222d5b3de56834 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:58:58 -0500 Subject: [PATCH 04/31] Stops ignoring ./gradle --- .gitignore | 1 - gradle/libs.versions.toml | 16 ++++++++++++++++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 45633 bytes gradle/wrapper/gradle-wrapper.properties | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 gradle/libs.versions.toml create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties diff --git a/.gitignore b/.gitignore index 0595f8c..dfac3e3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ target/ # Gradle .gradle/ -gradle/ build/ # Common working directory diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..838097b --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,16 @@ +# This file was generated by the Gradle 'init' task. +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format + +[versions] +com-github-earthcow-javadiscordwebhook = "master-SNAPSHOT" +dev-dejvokep-boosted-yaml = "1.3.7" +org-geysermc-floodgate-api = "2.2.4-SNAPSHOT" +org-jetbrains-annotations = "24.1.0" +org-spigotmc-spigot-api = "1.17-R0.1-SNAPSHOT" + +[libraries] +com-github-earthcow-javadiscordwebhook = { module = "com.github.EarthCow:JavaDiscordWebhook", version.ref = "com-github-earthcow-javadiscordwebhook" } +dev-dejvokep-boosted-yaml = { module = "dev.dejvokep:boosted-yaml", version.ref = "dev-dejvokep-boosted-yaml" } +org-geysermc-floodgate-api = { module = "org.geysermc.floodgate:api", version.ref = "org-geysermc-floodgate-api" } +org-jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "org-jetbrains-annotations" } +org-spigotmc-spigot-api = { module = "org.spigotmc:spigot-api", version.ref = "org-spigotmc-spigot-api" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..f8e1ee3125fe0768e9a76ee977ac089eb657005e GIT binary patch literal 45633 zcma&NV|1n6wyqu9PQ|uu+csuwn-$x(T~Woh?Nr6KUD3(A)@l1Yd+oj6Z_U=8`RAE` z#vE6_`?!1WLs1443=Ieh3JM4ai0JG2|2{}S&_HrxszP*9^5P7#QX*pVDq?D?;6T8C z{bWO1$9at%!*8ax*TT&F99vwf1Ls+3lklsb|bC`H`~Q z_w}*E9P=Wq;PYlGYhZ^lt#N97bt5aZ#mQcOr~h^B;R>f-b0gf{y(;VA{noAt`RZzU z7vQWD{%|q!urW2j0Z&%ChtL(^9m` zgaU%|B;V#N_?%iPvu0PVkX=1m9=*SEGt-Lp#&Jh%rz6EJXlV^O5B5YfM5j{PCeElx z8sipzw8d=wVhFK+@mgrWyA)Sv3BJq=+q+cL@=wuH$2;LjY z^{&+X4*HFA0{QvlM_V4PTQjIdd;d|2YuN;s|bi!@<)r-G%TuOCHz$O(_-K z)5in&6uNN<0UfwY=K>d;cL{{WK2FR|NihJMN0Q4X+(1lE)$kY?T$7UWleIU`i zQG#X-&&m-8x^(;n@o}$@vPMYRoq~|FqC~CU3MnoiifD{(CwAGd%X#kFHq#4~%_a!{ zeX{XXDT#(DvX7NtAs7S}2ZuiZ>gtd;tCR7E)3{J^`~#Vd**9qz%~JRFAiZf{zt|Dr zvQw!)n7fNUn_gH`o9?8W8t_%x6~=y*`r46bjj(t{YU*qfqd}J}*mkgUfsXTI>Uxl6 z)Fj>#RMy{`wINIR;{_-!xGLgVaTfNJ2-)%YUfO&X5z&3^E#4?k-_|Yv$`fpgYkvnA%E{CiV zP|-zAf8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++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists From 3c7ce3c6dabd5b97252944a0aef3cac4e38d36d5 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Sun, 4 Jan 2026 16:49:21 -0500 Subject: [PATCH 05/31] Makes the Message webhook field local to #execute --- .../xyz/earthcow/themistodiscord/Message.java | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 589cbc1..e5ff31e 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -25,9 +25,6 @@ public class Message { @NotNull private final String webhookUrl; - @NotNull - private DiscordWebhook webhook; - @Nullable private final Section handling; @@ -56,22 +53,27 @@ public Message(@NotNull Section message) { } // Set the webhook url for this message this.webhookUrl = localWebhookUrl; - this.webhook = new DiscordWebhook(localWebhookUrl); // Define the handling section this.handling = message.getSection("Handling", null); } - private void handleMessageContent( + private DiscordWebhook constructWebhook( @NotNull Player player, @NotNull String detectionType, double score, double ping, double tps ) { - // Define a new webhook object to clear previous contents (mostly for embeds) - this.webhook = new DiscordWebhook(webhookUrl); + // Create a new webhook object + DiscordWebhook webhook = new DiscordWebhook(webhookUrl); + + // Return the webhook url if JSON is set + String jsonString = message.getString("Json", ""); + if (!jsonString.isEmpty() && !jsonString.equals("{}")) { + return webhook; + } // Set the custom webhook parameters if (message.getBoolean("CustomWebhook.Enabled", false)) { @@ -97,7 +99,7 @@ private void handleMessageContent( Section embedSection = message.getSection("Embed"); if (embedSection == null) { - return; + return webhook; } // Define the embed object @@ -221,15 +223,16 @@ private void handleMessageContent( } webhook.addEmbed(embed); + return webhook; } public void execute(@NotNull Player player, @NotNull String detectionType, double score, double ping, double tps, @Nullable CommandSender sender) { // Using a single thread executor ensures messages are not concurrently modified and sent in succession executor.submit(() -> { + DiscordWebhook webhook = constructWebhook(player, detectionType, score, ping, tps); + String jsonString = message.getString("Json", ""); try { - String jsonString = message.getString("Json", ""); if (jsonString.isEmpty() || jsonString.equals("{}")) { - handleMessageContent(player, detectionType, score, ping, tps); webhook.execute(); } else { webhook.execute(Utils.handleAllPlaceholders(jsonString, player, detectionType, score, ping, tps)); @@ -283,7 +286,8 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl } ThemisToDiscord.log(LogLevel.ERROR, msg); ThemisToDiscord.log(LogLevel.DEBUG, "Exception: " + e); - ThemisToDiscord.log(LogLevel.DEBUG, "Webhook: " + webhook.getJsonString()); + ThemisToDiscord.log(LogLevel.DEBUG, "Webhook: " + + (jsonString.isEmpty() || jsonString.equals("{}") ? webhook.getJsonString() : jsonString)); } }); } From 13d6ffca73e33adf9f6f3063e5c3444020ba26ca Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Sun, 4 Jan 2026 17:34:11 -0500 Subject: [PATCH 06/31] Transitions to dependency injection --- .../themistodiscord/Configuration.java | 38 ++++++------ .../xyz/earthcow/themistodiscord/Message.java | 58 +++++++++++-------- .../themistodiscord/ThemisListener.java | 11 +++- .../themistodiscord/ThemisToDiscord.java | 38 ++++-------- .../earthcow/themistodiscord/TtdCommand.java | 19 +++--- .../xyz/earthcow/themistodiscord/Utils.java | 33 ++++++++--- 6 files changed, 111 insertions(+), 86 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Configuration.java b/src/main/java/xyz/earthcow/themistodiscord/Configuration.java index 5d2f61a..26949c9 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Configuration.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Configuration.java @@ -14,17 +14,18 @@ import java.util.stream.Collectors; public class Configuration { + private final ThemisToDiscord ttd; private YamlDocument config; + private Utils utils; private Set messages; - public Configuration() { - ThemisToDiscord plugin = ThemisToDiscord.instance; - + public Configuration(ThemisToDiscord ttd) { + this.ttd = ttd; try { config = YamlDocument.create( - new File(plugin.getDataFolder(), "config.yml"), - Objects.requireNonNull(plugin.getResource("config.yml")), + new File(ttd.getDataFolder(), "config.yml"), + Objects.requireNonNull(ttd.getResource("config.yml")), GeneralSettings.DEFAULT, LoaderSettings.builder().setAutoUpdate(true).build(), DumperSettings.DEFAULT, UpdaterSettings.builder().setVersioning(new BasicVersioning("config-version")) @@ -34,20 +35,26 @@ public Configuration() { config.update(); config.save(); - load(); } catch (IOException e){ - ThemisToDiscord.log(LogLevel.ERROR, "Could not create/load plugin config, disabling! Additional info: \n" + e); - plugin.getPluginLoader().disablePlugin(plugin); + ttd.log(LogLevel.ERROR, "Could not create/load plugin config, disabling! Additional info: \n" + e); + ttd.getPluginLoader().disablePlugin(ttd); return; } - if (ThemisToDiscord.isInvalidWebhookUrl(config.getString("webhookUrl"))) { - ThemisToDiscord.log(LogLevel.WARN, "Webhook url is missing or invalid! Set one using /ttd url "); - } + this.utils = new Utils(ttd, config); + + load(); } private void load() { - messages = config.getSection("Messages").getRoutesAsStrings(false).stream().map(route -> new Message(config.getSection("Messages").getSection(route))).collect(Collectors.toSet()); + messages = config.getSection("Messages").getRoutesAsStrings(false).stream() + .map(route -> + new Message(ttd, utils, config.getSection("Messages").getSection(route)) + ) + .collect(Collectors.toSet()); + if (Utils.isInvalidWebhookUrl(config.getString("webhookUrl"))) { + ttd.log(LogLevel.WARN, "Webhook url is missing or invalid! Set one using /ttd url "); + } } public YamlDocument get() { @@ -62,7 +69,7 @@ public void save() { try { config.save(); } catch (IOException e) { - ThemisToDiscord.log(LogLevel.ERROR, "Failed to save plugin config! Additional info: \n" + e); + ttd.log(LogLevel.ERROR, "Failed to save plugin config! Additional info: \n" + e); } } @@ -73,11 +80,8 @@ public void reload() { } config.reload(); load(); - if (ThemisToDiscord.isInvalidWebhookUrl(config.getString("webhookUrl"))) { - ThemisToDiscord.log(LogLevel.WARN, "Webhook url is missing or invalid! Set one using /ttd url "); - } } catch (IOException e) { - ThemisToDiscord.log(LogLevel.ERROR, "Failed to reload plugin config! Additional info: \n" + e); + ttd.log(LogLevel.ERROR, "Failed to reload plugin config! Additional info: \n" + e); } } diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index e5ff31e..4f410fb 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -18,6 +18,11 @@ import java.util.concurrent.Executors; public class Message { + @NotNull + private final ThemisToDiscord ttd; + @NotNull + private final Utils utils; + @NotNull private final Section message; @NotNull @@ -34,7 +39,10 @@ public class Message { private final ExecutorService executor = Executors.newSingleThreadExecutor(); - public Message(@NotNull Section message) { + public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Section message) { + this.ttd = ttd; + this.utils = utils; + this.message = message; this.name = message.getNameAsString(); @@ -42,9 +50,9 @@ public Message(@NotNull Section message) { String localWebhookUrl; if (message.getBoolean("CustomWebhook.Enabled", false)) { localWebhookUrl = message.getString("CustomWebhook.Url", ""); - if (ThemisToDiscord.isInvalidWebhookUrl(localWebhookUrl)) { + if (Utils.isInvalidWebhookUrl(localWebhookUrl)) { if (!localWebhookUrl.isEmpty()) { - ThemisToDiscord.log(LogLevel.WARN, "Invalid custom webhook url for message: " + name + "! This message will use the global webhook url."); + ttd.log(LogLevel.WARN, "Invalid custom webhook url for message: " + name + "! This message will use the global webhook url."); } localWebhookUrl = message.getRoot().getString("webhookUrl"); } @@ -78,12 +86,12 @@ private DiscordWebhook constructWebhook( // Set the custom webhook parameters if (message.getBoolean("CustomWebhook.Enabled", false)) { webhook.setUsername( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( message.getString("CustomWebhook.Name"), player, detectionType, score, ping, tps) ); webhook.setAvatarUrl( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( message.getString("CustomWebhook.AvatarUrl"), player, detectionType, score, ping, tps) ); @@ -91,7 +99,7 @@ private DiscordWebhook constructWebhook( // Set the message content webhook.setContent( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( message.getString("Content"), player, detectionType, score, ping, tps ) @@ -112,23 +120,23 @@ private DiscordWebhook constructWebhook( Color.decode(colorStr) ); } catch (NumberFormatException e) { - ThemisToDiscord.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); - ThemisToDiscord.log(LogLevel.DEBUG, "Exception: " + e); + ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); + ttd.log(LogLevel.DEBUG, "Exception: " + e); embed.setColor(Color.BLACK); } // Set the author if (embedSection.get("Author", null) != null) { embed.setAuthor( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Author.Name"), player, detectionType, score, ping, tps ), - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Author.Url"), player, detectionType, score, ping, tps ), - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Author.ImageUrl"), player, detectionType, score, ping, tps ) @@ -141,13 +149,13 @@ private DiscordWebhook constructWebhook( // Set the title if (embedSection.get("Title", null) != null) { embed.setTitle( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Title.Text", null), player, detectionType, score, ping, tps ) ); embed.setUrl( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Title.Url", null), player, detectionType, score, ping, tps ) @@ -156,7 +164,7 @@ private DiscordWebhook constructWebhook( // Set the description embed.setDescription( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Description", null), player, detectionType, score, ping, tps ) @@ -177,11 +185,11 @@ private DiscordWebhook constructWebhook( boolean inline = parts.length < 3 || Boolean.parseBoolean(parts[2]); embed.addField( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( parts[0], player, detectionType, score, ping, tps ), - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( parts[1], player, detectionType, score, ping, tps ), @@ -197,7 +205,7 @@ private DiscordWebhook constructWebhook( // Set the image url embed.setImage( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("ImageUrl", null), player, detectionType, score, ping, tps ) @@ -206,11 +214,11 @@ private DiscordWebhook constructWebhook( // Set the footer if (embedSection.get("Footer", null) != null) { embed.setFooter( - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Footer.Text", null), player, detectionType, score, ping, tps ), - Utils.handleAllPlaceholders( + utils.handleAllPlaceholders( embedSection.getString("Footer.IconUrl", null), player, detectionType, score, ping, tps ) @@ -235,7 +243,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl if (jsonString.isEmpty() || jsonString.equals("{}")) { webhook.execute(); } else { - webhook.execute(Utils.handleAllPlaceholders(jsonString, player, detectionType, score, ping, tps)); + webhook.execute(utils.handleAllPlaceholders(jsonString, player, detectionType, score, ping, tps)); } if (sender != null) { sender.sendMessage(ChatColor.GREEN + "Message: " + name + ", was sent!"); @@ -273,7 +281,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl break; } } catch (IndexOutOfBoundsException | NumberFormatException ex) { - ThemisToDiscord.log(LogLevel.DEBUG, "Secondary exception: " + ex); + ttd.log(LogLevel.DEBUG, "Secondary exception: " + ex); } } } @@ -284,9 +292,9 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl if (sender != null) { sender.sendMessage(ChatColor.RED + msg); } - ThemisToDiscord.log(LogLevel.ERROR, msg); - ThemisToDiscord.log(LogLevel.DEBUG, "Exception: " + e); - ThemisToDiscord.log(LogLevel.DEBUG, "Webhook: " + + ttd.log(LogLevel.ERROR, msg); + ttd.log(LogLevel.DEBUG, "Exception: " + e); + ttd.log(LogLevel.DEBUG, "Webhook: " + (jsonString.isEmpty() || jsonString.equals("{}") ? webhook.getJsonString() : jsonString)); } }); @@ -304,7 +312,7 @@ public void forceExecutorShutdown() { // Should only be performed upon reload int unsentMessages = executor.shutdownNow().size(); if (unsentMessages > 0) { - ThemisToDiscord.log(LogLevel.WARN, unsentMessages + " messages were cancelled. For message: " + name); + ttd.log(LogLevel.WARN, unsentMessages + " messages were cancelled. For message: " + name); } } diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java index 3962a6b..30f05fe 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java @@ -9,8 +9,15 @@ import org.bukkit.event.Listener; public class ThemisListener implements Listener { + private final ThemisToDiscord ttd; + private final Configuration config; private boolean pingSupportedVersion = true; + public ThemisListener(ThemisToDiscord ttd, Configuration config) { + this.ttd = ttd; + this.config = config; + } + @EventHandler public void onViolationEvent(ViolationEvent event) { Player player = event.getPlayer(); @@ -22,14 +29,14 @@ public void onViolationEvent(ViolationEvent event) { ping = (ThemisApi.getPing(player) != null) ? ThemisApi.getPing(player) : 0; tps = ThemisApi.getTps(); } catch (NoSuchMethodError e) { - ThemisToDiscord.log(LogLevel.WARN, "Please update Themis to 0.15.3 or higher for player ping and server tps!"); + ttd.log(LogLevel.WARN, "Please update Themis to 0.15.3 or higher for player ping and server tps!"); pingSupportedVersion = false; } } double score = Math.round(ThemisApi.getViolationScore(player, checkType) * 100.0) / 100.0; - for (Message message : ThemisToDiscord.config.getMessages()) { + for (Message message : config.getMessages()) { Section handling = message.getHandling(); if (handling == null || !handling.getBoolean("Enabled", false)) { diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java index c34cab9..61efa4b 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java @@ -1,56 +1,42 @@ package xyz.earthcow.themistodiscord; import org.bukkit.plugin.java.JavaPlugin; -import org.geysermc.floodgate.api.FloodgateApi; -import org.jetbrains.annotations.Nullable; -import xyz.earthcow.discordwebhook.DiscordWebhook; import java.util.Objects; public final class ThemisToDiscord extends JavaPlugin { - public static ThemisToDiscord instance; - public static Configuration config; - public static FloodgateApi floodgateApi; + private Configuration config; @Override public void onEnable() { - instance = this; + this.config = new Configuration(this); - config = new Configuration(); - - TtdCommand ttdCommand = new TtdCommand(); + TtdCommand ttdCommand = new TtdCommand(config); Objects.requireNonNull(getCommand("ttd")).setExecutor(ttdCommand); Objects.requireNonNull(getCommand("ttd")).setTabCompleter(ttdCommand); - getServer().getPluginManager().registerEvents(new ThemisListener(), this); - - if (getServer().getPluginManager().isPluginEnabled("Floodgate")) { - log("Found Floodgate! Enabling features..."); - floodgateApi = FloodgateApi.getInstance(); - } else { - log(LogLevel.WARN, "Floodgate not found! Some features may be disabled."); - } + getServer().getPluginManager().registerEvents(new ThemisListener(this, config), this); } @Override public void onDisable() {} - public static void log(String message) { - instance.getLogger().info(message); + public void log(String message) { + getLogger().info(message); } - public static void log(LogLevel logLevel, String message) { + public void log(LogLevel logLevel, String message) { switch (logLevel) { case DEBUG: if (config.get().getBoolean("debug")) { - instance.getLogger().warning("[DEBUG] " + message); + getLogger().warning("[DEBUG] " + message); } break; case WARN: - instance.getLogger().warning(message); + getLogger().warning(message); break; case ERROR: - instance.getLogger().severe(message); + getLogger().severe(message); break; default: log(message); @@ -58,8 +44,4 @@ public static void log(LogLevel logLevel, String message) { } } - public static boolean isInvalidWebhookUrl(@Nullable String url) { - if (url == null) return true; - return !DiscordWebhook.WEBHOOK_PATTERN.matcher(url).matches(); - } } diff --git a/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java b/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java index a4c4286..64f2f74 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java +++ b/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java @@ -15,6 +15,11 @@ import java.util.stream.Collectors; public class TtdCommand implements CommandExecutor, TabCompleter { + private final Configuration config; + + public TtdCommand(Configuration config) { + this.config = config; + } @Override public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String cmd, @NotNull String[] args) { @@ -27,14 +32,14 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command return true; } String webhookUrl = args[1]; - if (ThemisToDiscord.isInvalidWebhookUrl(webhookUrl)) { + if (Utils.isInvalidWebhookUrl(webhookUrl)) { sender.sendMessage(ChatColor.RED + "That is not a valid webhook url!"); return true; } - ThemisToDiscord.config.get().set("webhookUrl", webhookUrl); - ThemisToDiscord.config.save(); + config.get().set("webhookUrl", webhookUrl); + config.save(); // Re-evaluate config messages for changes in webhook url - ThemisToDiscord.config.reload(); + config.reload(); sender.sendMessage(ChatColor.GREEN + "Successfully set the webhook url!"); break; case "msg": @@ -43,7 +48,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command return true; } - Message message = ThemisToDiscord.config.getMessages().stream().filter(msg -> msg.getName().equals(args[1])).findFirst().orElse(null); + Message message = config.getMessages().stream().filter(msg -> msg.getName().equals(args[1])).findFirst().orElse(null); if (message == null) { sender.sendMessage(ChatColor.RED + "The message: " + args[1] + " does not exist!"); return true; @@ -78,7 +83,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command message.execute(player, type, score, ping, tps, (sender instanceof Player) ? sender : null); break; case "reload": - ThemisToDiscord.config.reload(); + config.reload(); sender.sendMessage(ChatColor.GREEN + "Successfully reloaded the configuration file!"); break; default: @@ -135,7 +140,7 @@ public List onTabComplete(@NotNull CommandSender sender, @NotNull Comman if (args[0].equalsIgnoreCase("msg")) { if (args.length == 2) { - return ThemisToDiscord.config.getMessages().stream().map(Message::getName).collect(Collectors.toList()); + return config.getMessages().stream().map(Message::getName).collect(Collectors.toList()); } List completions = new ArrayList<>(); diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 880afae..2aa667d 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -1,20 +1,35 @@ package xyz.earthcow.themistodiscord; +import dev.dejvokep.boostedyaml.YamlDocument; import org.bukkit.entity.Player; +import org.geysermc.floodgate.api.FloodgateApi; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import xyz.earthcow.discordwebhook.DiscordWebhook; public class Utils { + private FloodgateApi floodgateApi; + private final YamlDocument config; + + public Utils(ThemisToDiscord ttd, YamlDocument configDocument) { + if (ttd.getServer().getPluginManager().isPluginEnabled("Floodgate")) { + ttd.log("Found Floodgate! Enabling features..."); + floodgateApi = FloodgateApi.getInstance(); + } else { + ttd.log(LogLevel.WARN, "Floodgate not found! Some features may be disabled."); + } + this.config = configDocument; + } @Nullable - public static String handleFloodgatePlaceholders(@Nullable String str, @NotNull Player player) { + public String handleFloodgatePlaceholders(@Nullable String str, @NotNull Player player) { if (str == null) {return null;} String os; - if (ThemisToDiscord.floodgateApi == null) { + if (floodgateApi == null) { os = "install_floodgate"; } else { - if (ThemisToDiscord.floodgateApi.isFloodgatePlayer(player.getUniqueId())) { - os = ThemisToDiscord.floodgateApi.getPlayer(player.getUniqueId()).getDeviceOs() + ""; + if (floodgateApi.isFloodgatePlayer(player.getUniqueId())) { + os = floodgateApi.getPlayer(player.getUniqueId()).getDeviceOs() + ""; } else { os = "Java"; } @@ -24,12 +39,12 @@ public static String handleFloodgatePlaceholders(@Nullable String str, @NotNull } @Nullable - public static String handleAvatarUrlPlaceholders(@Nullable String str, @NotNull Player player) { + public String handleAvatarUrlPlaceholders(@Nullable String str, @NotNull Player player) { if (str == null) {return null;} return str .replaceAll( "%avatar_url%", - handlePlayerPlaceholders(ThemisToDiscord.config.get().getString("AvatarUrl"), player) + handlePlayerPlaceholders(config.getString("AvatarUrl"), player) ); } @@ -58,7 +73,7 @@ public static String handleStatPlaceholders(@Nullable String str, double score, } @Nullable - public static String handleAllPlaceholders( + public String handleAllPlaceholders( @Nullable String str, @NotNull Player player, @NotNull String detectionType, @@ -84,4 +99,8 @@ public static String handleAllPlaceholders( ); } + public static boolean isInvalidWebhookUrl(@Nullable String url) { + if (url == null) return true; + return !DiscordWebhook.WEBHOOK_PATTERN.matcher(url).matches(); + } } From 81e7435b830a53fbe5ad19e2c43a646ba0eb9721 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Sun, 4 Jan 2026 17:49:47 -0500 Subject: [PATCH 07/31] Adds null annotations Also defers YamlDocument error handling to ThemisToDiscord --- .../themistodiscord/Configuration.java | 38 +++++++++---------- .../themistodiscord/ThemisListener.java | 7 +++- .../themistodiscord/ThemisToDiscord.java | 9 ++++- .../earthcow/themistodiscord/TtdCommand.java | 3 +- .../xyz/earthcow/themistodiscord/Utils.java | 4 +- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Configuration.java b/src/main/java/xyz/earthcow/themistodiscord/Configuration.java index 26949c9..2502f58 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Configuration.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Configuration.java @@ -6,6 +6,7 @@ import dev.dejvokep.boostedyaml.settings.general.GeneralSettings; import dev.dejvokep.boostedyaml.settings.loader.LoaderSettings; import dev.dejvokep.boostedyaml.settings.updater.UpdaterSettings; +import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.IOException; @@ -14,32 +15,29 @@ import java.util.stream.Collectors; public class Configuration { + @NotNull private final ThemisToDiscord ttd; - private YamlDocument config; - private Utils utils; + @NotNull + private final YamlDocument config; + @NotNull + private final Utils utils; private Set messages; - public Configuration(ThemisToDiscord ttd) { + public Configuration(@NotNull ThemisToDiscord ttd) throws IOException { this.ttd = ttd; - try { - config = YamlDocument.create( - new File(ttd.getDataFolder(), "config.yml"), - Objects.requireNonNull(ttd.getResource("config.yml")), - GeneralSettings.DEFAULT, - LoaderSettings.builder().setAutoUpdate(true).build(), DumperSettings.DEFAULT, - UpdaterSettings.builder().setVersioning(new BasicVersioning("config-version")) - .setOptionSorting(UpdaterSettings.OptionSorting.SORT_BY_DEFAULTS) - .build() - ); - config.update(); - config.save(); - } catch (IOException e){ - ttd.log(LogLevel.ERROR, "Could not create/load plugin config, disabling! Additional info: \n" + e); - ttd.getPluginLoader().disablePlugin(ttd); - return; - } + config = YamlDocument.create( + new File(ttd.getDataFolder(), "config.yml"), + Objects.requireNonNull(ttd.getResource("config.yml")), + GeneralSettings.DEFAULT, + LoaderSettings.builder().setAutoUpdate(true).build(), DumperSettings.DEFAULT, + UpdaterSettings.builder().setVersioning(new BasicVersioning("config-version")) + .setOptionSorting(UpdaterSettings.OptionSorting.SORT_BY_DEFAULTS) + .build() + ); + config.update(); + config.save(); this.utils = new Utils(ttd, config); diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java index 30f05fe..6d928b8 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java @@ -7,19 +7,22 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.jetbrains.annotations.NotNull; public class ThemisListener implements Listener { + @NotNull private final ThemisToDiscord ttd; + @NotNull private final Configuration config; private boolean pingSupportedVersion = true; - public ThemisListener(ThemisToDiscord ttd, Configuration config) { + public ThemisListener(@NotNull ThemisToDiscord ttd, @NotNull Configuration config) { this.ttd = ttd; this.config = config; } @EventHandler - public void onViolationEvent(ViolationEvent event) { + public void onViolationEvent(@NotNull ViolationEvent event) { Player player = event.getPlayer(); CheckType checkType = event.getType(); diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java index 61efa4b..2a76f3f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java @@ -2,6 +2,7 @@ import org.bukkit.plugin.java.JavaPlugin; +import java.io.IOException; import java.util.Objects; public final class ThemisToDiscord extends JavaPlugin { @@ -9,7 +10,13 @@ public final class ThemisToDiscord extends JavaPlugin { @Override public void onEnable() { - this.config = new Configuration(this); + try { + this.config = new Configuration(this); + } catch (IOException e){ + log(LogLevel.ERROR, "Could not create/load plugin config, disabling! Additional info: \n" + e); + getPluginLoader().disablePlugin(this); + return; + } TtdCommand ttdCommand = new TtdCommand(config); Objects.requireNonNull(getCommand("ttd")).setExecutor(ttdCommand); diff --git a/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java b/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java index 64f2f74..d3afa69 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java +++ b/src/main/java/xyz/earthcow/themistodiscord/TtdCommand.java @@ -15,9 +15,10 @@ import java.util.stream.Collectors; public class TtdCommand implements CommandExecutor, TabCompleter { + @NotNull private final Configuration config; - public TtdCommand(Configuration config) { + public TtdCommand(@NotNull Configuration config) { this.config = config; } diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 2aa667d..41dd39d 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -8,10 +8,12 @@ import xyz.earthcow.discordwebhook.DiscordWebhook; public class Utils { + @Nullable private FloodgateApi floodgateApi; + @NotNull private final YamlDocument config; - public Utils(ThemisToDiscord ttd, YamlDocument configDocument) { + public Utils(@NotNull ThemisToDiscord ttd, @NotNull YamlDocument configDocument) { if (ttd.getServer().getPluginManager().isPluginEnabled("Floodgate")) { ttd.log("Found Floodgate! Enabling features..."); floodgateApi = FloodgateApi.getInstance(); From c855ed3df9e23eac80ed4ae90ba35bc5d6622725 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Mon, 5 Jan 2026 15:42:34 -0500 Subject: [PATCH 08/31] String#replaceAll -> #replace Mistakeningly using replaceAll instead of replace for literal string replacement and not regex puts an unnecessary load on system resources. --- .../xyz/earthcow/themistodiscord/Message.java | 2 +- .../java/xyz/earthcow/themistodiscord/Utils.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 4f410fb..ea7a8c8 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -114,7 +114,7 @@ private DiscordWebhook constructWebhook( DiscordWebhook.EmbedObject embed = new DiscordWebhook.EmbedObject(); // Set the color - String colorStr = embedSection.getString("Color").replaceAll("%category_color%", message.getRoot().getString("categoryColors." + detectionType)); + String colorStr = embedSection.getString("Color").replace("%category_color%", message.getRoot().getString("categoryColors." + detectionType)); try { embed.setColor( Color.decode(colorStr) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 41dd39d..5fa210e 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -37,14 +37,14 @@ public String handleFloodgatePlaceholders(@Nullable String str, @NotNull Player } } return str - .replaceAll("%os%", os); + .replace("%os%", os); } @Nullable public String handleAvatarUrlPlaceholders(@Nullable String str, @NotNull Player player) { if (str == null) {return null;} return str - .replaceAll( + .replace( "%avatar_url%", handlePlayerPlaceholders(config.getString("AvatarUrl"), player) ); @@ -54,24 +54,24 @@ public String handleAvatarUrlPlaceholders(@Nullable String str, @NotNull Player public static String handlePlayerPlaceholders(@Nullable String str, @NotNull Player player) { if (str == null) {return null;} return str - .replaceAll("%player_name%", player.getName()) - .replaceAll("%player_uuid%", player.getUniqueId() + ""); + .replace("%player_name%", player.getName()) + .replace("%player_uuid%", player.getUniqueId() + ""); } @Nullable public static String handleDetectionTypePlaceholders(@Nullable String str, @NotNull String detectionType) { if (str == null) {return null;} return str - .replaceAll("%detection_type%", detectionType); + .replace("%detection_type%", detectionType); } @Nullable public static String handleStatPlaceholders(@Nullable String str, double score, double ping, double tps) { if (str == null) {return null;} return str - .replaceAll("%score%", score + "") - .replaceAll("%ping%", ping + "") - .replaceAll("%tps%", tps + ""); + .replace("%score%", score + "") + .replace("%ping%", ping + "") + .replace("%tps%", tps + ""); } @Nullable From 98474ff1c57d37835805bdc8014226f98d0dfa77 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Mon, 5 Jan 2026 15:51:29 -0500 Subject: [PATCH 09/31] Condenses placeholder handling logic --- .../xyz/earthcow/themistodiscord/Utils.java | 66 ++++--------------- 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 5fa210e..5001192 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -23,9 +23,8 @@ public Utils(@NotNull ThemisToDiscord ttd, @NotNull YamlDocument configDocument) this.config = configDocument; } - @Nullable - public String handleFloodgatePlaceholders(@Nullable String str, @NotNull Player player) { - if (str == null) {return null;} + @NotNull + private String handleFloodgatePlaceholders(@NotNull String str, @NotNull Player player) { String os; if (floodgateApi == null) { os = "install_floodgate"; @@ -40,40 +39,6 @@ public String handleFloodgatePlaceholders(@Nullable String str, @NotNull Player .replace("%os%", os); } - @Nullable - public String handleAvatarUrlPlaceholders(@Nullable String str, @NotNull Player player) { - if (str == null) {return null;} - return str - .replace( - "%avatar_url%", - handlePlayerPlaceholders(config.getString("AvatarUrl"), player) - ); - } - - @Nullable - public static String handlePlayerPlaceholders(@Nullable String str, @NotNull Player player) { - if (str == null) {return null;} - return str - .replace("%player_name%", player.getName()) - .replace("%player_uuid%", player.getUniqueId() + ""); - } - - @Nullable - public static String handleDetectionTypePlaceholders(@Nullable String str, @NotNull String detectionType) { - if (str == null) {return null;} - return str - .replace("%detection_type%", detectionType); - } - - @Nullable - public static String handleStatPlaceholders(@Nullable String str, double score, double ping, double tps) { - if (str == null) {return null;} - return str - .replace("%score%", score + "") - .replace("%ping%", ping + "") - .replace("%tps%", tps + ""); - } - @Nullable public String handleAllPlaceholders( @Nullable String str, @@ -83,22 +48,17 @@ public String handleAllPlaceholders( double ping, double tps ) { - if (str == null) {return null;} - return handleStatPlaceholders( - handleDetectionTypePlaceholders( - handlePlayerPlaceholders( - handleAvatarUrlPlaceholders( - handleFloodgatePlaceholders( - str, player - ), - player - ), - player - ), - detectionType - ), - score, ping, tps - ); + if (str == null || str.isEmpty()) { + return str; + } + return handleFloodgatePlaceholders(str, player) + .replace("%avatar_url%", config.getString("AvatarUrl")) + .replace("%player_name%", player.getName()) + .replace("%player_uuid%", player.getUniqueId() + "") + .replace("%detection_type%", detectionType) + .replace("%score%", score + "") + .replace("%ping%", ping + "") + .replace("%tps%", tps + ""); } public static boolean isInvalidWebhookUrl(@Nullable String url) { From df3385a4eab58d1c29f7a2e34608c5ad20563384 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:05:23 -0500 Subject: [PATCH 10/31] Uses toString in Utils for efficiency --- src/main/java/xyz/earthcow/themistodiscord/Utils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 5001192..bfcf9a4 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -30,7 +30,7 @@ private String handleFloodgatePlaceholders(@NotNull String str, @NotNull Player os = "install_floodgate"; } else { if (floodgateApi.isFloodgatePlayer(player.getUniqueId())) { - os = floodgateApi.getPlayer(player.getUniqueId()).getDeviceOs() + ""; + os = floodgateApi.getPlayer(player.getUniqueId()).getDeviceOs().toString(); } else { os = "Java"; } @@ -54,11 +54,11 @@ public String handleAllPlaceholders( return handleFloodgatePlaceholders(str, player) .replace("%avatar_url%", config.getString("AvatarUrl")) .replace("%player_name%", player.getName()) - .replace("%player_uuid%", player.getUniqueId() + "") + .replace("%player_uuid%", player.getUniqueId().toString()) .replace("%detection_type%", detectionType) - .replace("%score%", score + "") - .replace("%ping%", ping + "") - .replace("%tps%", tps + ""); + .replace("%score%", Double.toString(score)) + .replace("%ping%", Double.toString(ping)) + .replace("%tps%", Double.toString(tps)); } public static boolean isInvalidWebhookUrl(@Nullable String url) { From d050cd5c3f52b223eb73eca6fc9f2f5de9114bcf Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:10:36 -0500 Subject: [PATCH 11/31] handleFloodgatePlaceholders -> getPlayerOs --- src/main/java/xyz/earthcow/themistodiscord/Utils.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index bfcf9a4..9f061bb 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -24,7 +24,7 @@ public Utils(@NotNull ThemisToDiscord ttd, @NotNull YamlDocument configDocument) } @NotNull - private String handleFloodgatePlaceholders(@NotNull String str, @NotNull Player player) { + private String getPlayerOs(@NotNull Player player) { String os; if (floodgateApi == null) { os = "install_floodgate"; @@ -35,8 +35,7 @@ private String handleFloodgatePlaceholders(@NotNull String str, @NotNull Player os = "Java"; } } - return str - .replace("%os%", os); + return os; } @Nullable @@ -51,8 +50,9 @@ public String handleAllPlaceholders( if (str == null || str.isEmpty()) { return str; } - return handleFloodgatePlaceholders(str, player) - .replace("%avatar_url%", config.getString("AvatarUrl")) + return str + .replace("%avatar_url%", config.getString("AvatarUrl", "")) + .replace("%os%", getPlayerOs(player)) .replace("%player_name%", player.getName()) .replace("%player_uuid%", player.getUniqueId().toString()) .replace("%detection_type%", detectionType) From 4d85584b120234495a07763d1bbe207ea406b3aa Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Mon, 5 Jan 2026 18:24:29 -0500 Subject: [PATCH 12/31] Replaces all placeholders at the same time TODO: Improve embed color logic --- .../xyz/earthcow/themistodiscord/Message.java | 180 +++++++----------- .../xyz/earthcow/themistodiscord/Utils.java | 1 + 2 files changed, 72 insertions(+), 109 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index ea7a8c8..e2670bb 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -28,7 +28,11 @@ public class Message { @NotNull private final String name; @NotNull - private final String webhookUrl; + private final DiscordWebhook webhook; + @NotNull + private final String webhookJson; + + private final boolean hasExplicitJson; @Nullable private final Section handling; @@ -59,87 +63,64 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect } else { localWebhookUrl = message.getRoot().getString("webhookUrl"); } - // Set the webhook url for this message - this.webhookUrl = localWebhookUrl; + // Set the webhook for this message + this.webhook = new DiscordWebhook(localWebhookUrl); + + // Set if the message uses explicit json + String jsonString = message.getString("Json", ""); + this.hasExplicitJson = !jsonString.isEmpty() && !jsonString.equals("{}"); + + // Determine and set the webhook json + if (hasExplicitJson) { + this.webhookJson = jsonString; + } else { + fillWebhookContent(webhook); + this.webhookJson = webhook.getJsonString(); + } // Define the handling section this.handling = message.getSection("Handling", null); } - private DiscordWebhook constructWebhook( - @NotNull Player player, - @NotNull String detectionType, - double score, - double ping, - double tps - ) { - // Create a new webhook object - DiscordWebhook webhook = new DiscordWebhook(webhookUrl); - - // Return the webhook url if JSON is set - String jsonString = message.getString("Json", ""); - if (!jsonString.isEmpty() && !jsonString.equals("{}")) { - return webhook; - } - + private void fillWebhookContent(@NotNull DiscordWebhook webhookToFill) { // Set the custom webhook parameters if (message.getBoolean("CustomWebhook.Enabled", false)) { - webhook.setUsername( - utils.handleAllPlaceholders( - message.getString("CustomWebhook.Name"), - player, detectionType, score, ping, tps) - ); - webhook.setAvatarUrl( - utils.handleAllPlaceholders( - message.getString("CustomWebhook.AvatarUrl"), - player, detectionType, score, ping, tps) - ); + webhookToFill.setUsername(message.getString("CustomWebhook.Name")); + webhookToFill.setAvatarUrl(message.getString("CustomWebhook.AvatarUrl")); } // Set the message content - webhook.setContent( - utils.handleAllPlaceholders( - message.getString("Content"), - player, detectionType, score, ping, tps - ) - ); + webhookToFill.setContent(message.getString("Content")); Section embedSection = message.getSection("Embed"); if (embedSection == null) { - return webhook; + return; } // Define the embed object DiscordWebhook.EmbedObject embed = new DiscordWebhook.EmbedObject(); // Set the color - String colorStr = embedSection.getString("Color").replace("%category_color%", message.getRoot().getString("categoryColors." + detectionType)); - try { - embed.setColor( - Color.decode(colorStr) - ); - } catch (NumberFormatException e) { - ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); - ttd.log(LogLevel.DEBUG, "Exception: " + e); - embed.setColor(Color.BLACK); + String colorStr = embedSection.getString("Color", ""); + if (!colorStr.contains("%category_color%")) { + try { + embed.setColor( + Color.decode(colorStr) + ); + } catch (NumberFormatException e) { + ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); + ttd.log(LogLevel.DEBUG, "Exception: " + e); + embed.setColor(Color.BLACK); + } } // Set the author if (embedSection.get("Author", null) != null) { embed.setAuthor( - utils.handleAllPlaceholders( - embedSection.getString("Author.Name"), - player, detectionType, score, ping, tps - ), - utils.handleAllPlaceholders( - embedSection.getString("Author.Url"), - player, detectionType, score, ping, tps - ), - utils.handleAllPlaceholders( - embedSection.getString("Author.ImageUrl"), - player, detectionType, score, ping, tps - ) + embedSection.getString("Author.Name"), + embedSection.getString("Author.Url"), + embedSection.getString("Author.ImageUrl") ); } @@ -148,27 +129,12 @@ private DiscordWebhook constructWebhook( // Set the title if (embedSection.get("Title", null) != null) { - embed.setTitle( - utils.handleAllPlaceholders( - embedSection.getString("Title.Text", null), - player, detectionType, score, ping, tps - ) - ); - embed.setUrl( - utils.handleAllPlaceholders( - embedSection.getString("Title.Url", null), - player, detectionType, score, ping, tps - ) - ); + embed.setTitle(embedSection.getString("Title.Text", null)); + embed.setUrl(embedSection.getString("Title.Url", null)); } // Set the description - embed.setDescription( - utils.handleAllPlaceholders( - embedSection.getString("Description", null), - player, detectionType, score, ping, tps - ) - ); + embed.setDescription(embedSection.getString("Description", null)); // Set the fields List fields = embedSection.getStringList("Fields"); @@ -184,17 +150,7 @@ private DiscordWebhook constructWebhook( boolean inline = parts.length < 3 || Boolean.parseBoolean(parts[2]); - embed.addField( - utils.handleAllPlaceholders( - parts[0], - player, detectionType, score, ping, tps - ), - utils.handleAllPlaceholders( - parts[1], - player, detectionType, score, ping, tps - ), - inline - ); + embed.addField(parts[0], parts[1], inline); } else { boolean inline = Boolean.parseBoolean(field); embed.addField("\u200e", "\u200e", inline); @@ -204,24 +160,13 @@ private DiscordWebhook constructWebhook( } // Set the image url - embed.setImage( - utils.handleAllPlaceholders( - embedSection.getString("ImageUrl", null), - player, detectionType, score, ping, tps - ) - ); + embed.setImage(embedSection.getString("ImageUrl", null)); // Set the footer if (embedSection.get("Footer", null) != null) { embed.setFooter( - utils.handleAllPlaceholders( - embedSection.getString("Footer.Text", null), - player, detectionType, score, ping, tps - ), - utils.handleAllPlaceholders( - embedSection.getString("Footer.IconUrl", null), - player, detectionType, score, ping, tps - ) + embedSection.getString("Footer.Text", null), + embedSection.getString("Footer.IconUrl", null) ); } @@ -230,20 +175,38 @@ private DiscordWebhook constructWebhook( embed.setTimestamp((new Date()).toInstant()); } - webhook.addEmbed(embed); - return webhook; + webhookToFill.addEmbed(embed); } public void execute(@NotNull Player player, @NotNull String detectionType, double score, double ping, double tps, @Nullable CommandSender sender) { // Using a single thread executor ensures messages are not concurrently modified and sent in succession executor.submit(() -> { - DiscordWebhook webhook = constructWebhook(player, detectionType, score, ping, tps); - String jsonString = message.getString("Json", ""); try { - if (jsonString.isEmpty() || jsonString.equals("{}")) { - webhook.execute(); + if (hasExplicitJson) { + webhook.execute(utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); } else { - webhook.execute(utils.handleAllPlaceholders(jsonString, player, detectionType, score, ping, tps)); + Section embedSection = message.getSection("Embed"); + if (embedSection != null && embedSection.getString("Color").contains("%category_color%") && !webhook.getEmbeds().isEmpty()) { + DiscordWebhook.EmbedObject embed = webhook.getEmbeds().getFirst(); + // Set the color + String colorStr = embedSection.getString("Color") + .replace( + "%category_color%", + message.getRoot().getString("categoryColors." + detectionType) + ); + try { + embed.setColor( + Color.decode(colorStr) + ); + } catch (NumberFormatException e) { + ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); + ttd.log(LogLevel.DEBUG, "Exception: " + e); + embed.setColor(Color.BLACK); + } + webhook.execute(utils.handleAllPlaceholders(webhook.getJsonString(), player, detectionType, score, ping, tps)); + } else { + webhook.execute(utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); + } } if (sender != null) { sender.sendMessage(ChatColor.GREEN + "Message: " + name + ", was sent!"); @@ -294,8 +257,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl } ttd.log(LogLevel.ERROR, msg); ttd.log(LogLevel.DEBUG, "Exception: " + e); - ttd.log(LogLevel.DEBUG, "Webhook: " + - (jsonString.isEmpty() || jsonString.equals("{}") ? webhook.getJsonString() : jsonString)); + ttd.log(LogLevel.DEBUG, "Webhook: " + webhookJson); } }); } diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 9f061bb..73e1d8f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -56,6 +56,7 @@ public String handleAllPlaceholders( .replace("%player_name%", player.getName()) .replace("%player_uuid%", player.getUniqueId().toString()) .replace("%detection_type%", detectionType) + .replace("%category_color%", config.getString("categoryColors." + detectionType)) .replace("%score%", Double.toString(score)) .replace("%ping%", Double.toString(ping)) .replace("%tps%", Double.toString(tps)); From 27113c9c26f86b2bf339406f3a652f6e41ec36e1 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:27:59 -0500 Subject: [PATCH 13/31] Correctly converts the category color to a decimal color --- src/main/java/xyz/earthcow/themistodiscord/Utils.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 73e1d8f..3774d83 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -56,12 +56,20 @@ public String handleAllPlaceholders( .replace("%player_name%", player.getName()) .replace("%player_uuid%", player.getUniqueId().toString()) .replace("%detection_type%", detectionType) - .replace("%category_color%", config.getString("categoryColors." + detectionType)) + .replace("%category_color%", hexToInteger(config.getString("categoryColors." + detectionType)).toString()) .replace("%score%", Double.toString(score)) .replace("%ping%", Double.toString(ping)) .replace("%tps%", Double.toString(tps)); } + private Integer hexToInteger(String hex) { + try { + return Integer.parseInt(hex.replace("#", ""), 16); + } catch (NumberFormatException e) { + return 0; + } + } + public static boolean isInvalidWebhookUrl(@Nullable String url) { if (url == null) return true; return !DiscordWebhook.WEBHOOK_PATTERN.matcher(url).matches(); From 21035099e79f6ac7b79f68c42799396bc461aa23 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:54:09 -0500 Subject: [PATCH 14/31] Implements immutable template pattern Utilizes updates made to the DiscordWebhook class to pregenerate the complete json webhook template. This template has placeholders replaced and then executes with the static DiscordWebhook#execute method statelessly. This new method is more efficient and ensures thread safety. --- .../xyz/earthcow/themistodiscord/Message.java | 64 ++++++------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index e2670bb..704a13f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -28,12 +28,10 @@ public class Message { @NotNull private final String name; @NotNull - private final DiscordWebhook webhook; + private final String webhookUrl; @NotNull private final String webhookJson; - private final boolean hasExplicitJson; - @Nullable private final Section handling; @@ -63,19 +61,15 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect } else { localWebhookUrl = message.getRoot().getString("webhookUrl"); } - // Set the webhook for this message - this.webhook = new DiscordWebhook(localWebhookUrl); - - // Set if the message uses explicit json - String jsonString = message.getString("Json", ""); - this.hasExplicitJson = !jsonString.isEmpty() && !jsonString.equals("{}"); + // Set the webhook url for this message + this.webhookUrl = localWebhookUrl; // Determine and set the webhook json - if (hasExplicitJson) { + String jsonString = message.getString("Json", ""); + if (!jsonString.isEmpty() && !jsonString.equals("{}")) { this.webhookJson = jsonString; } else { - fillWebhookContent(webhook); - this.webhookJson = webhook.getJsonString(); + this.webhookJson = getJsonWebhook(); } // Define the handling section @@ -83,19 +77,21 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect } - private void fillWebhookContent(@NotNull DiscordWebhook webhookToFill) { + private String getJsonWebhook() { + DiscordWebhook webhook = new DiscordWebhook(); + // Set the custom webhook parameters if (message.getBoolean("CustomWebhook.Enabled", false)) { - webhookToFill.setUsername(message.getString("CustomWebhook.Name")); - webhookToFill.setAvatarUrl(message.getString("CustomWebhook.AvatarUrl")); + webhook.setUsername(message.getString("CustomWebhook.Name")); + webhook.setAvatarUrl(message.getString("CustomWebhook.AvatarUrl")); } // Set the message content - webhookToFill.setContent(message.getString("Content")); + webhook.setContent(message.getString("Content")); Section embedSection = message.getSection("Embed"); if (embedSection == null) { - return; + return webhook.getJsonString(); } // Define the embed object @@ -103,7 +99,9 @@ private void fillWebhookContent(@NotNull DiscordWebhook webhookToFill) { // Set the color String colorStr = embedSection.getString("Color", ""); - if (!colorStr.contains("%category_color%")) { + if (colorStr.contains("%category_color%")) { + embed.setColorStr(colorStr); + } else { try { embed.setColor( Color.decode(colorStr) @@ -175,39 +173,15 @@ private void fillWebhookContent(@NotNull DiscordWebhook webhookToFill) { embed.setTimestamp((new Date()).toInstant()); } - webhookToFill.addEmbed(embed); + webhook.addEmbed(embed); + return webhook.getJsonString(); } public void execute(@NotNull Player player, @NotNull String detectionType, double score, double ping, double tps, @Nullable CommandSender sender) { // Using a single thread executor ensures messages are not concurrently modified and sent in succession executor.submit(() -> { try { - if (hasExplicitJson) { - webhook.execute(utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); - } else { - Section embedSection = message.getSection("Embed"); - if (embedSection != null && embedSection.getString("Color").contains("%category_color%") && !webhook.getEmbeds().isEmpty()) { - DiscordWebhook.EmbedObject embed = webhook.getEmbeds().getFirst(); - // Set the color - String colorStr = embedSection.getString("Color") - .replace( - "%category_color%", - message.getRoot().getString("categoryColors." + detectionType) - ); - try { - embed.setColor( - Color.decode(colorStr) - ); - } catch (NumberFormatException e) { - ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); - ttd.log(LogLevel.DEBUG, "Exception: " + e); - embed.setColor(Color.BLACK); - } - webhook.execute(utils.handleAllPlaceholders(webhook.getJsonString(), player, detectionType, score, ping, tps)); - } else { - webhook.execute(utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); - } - } + DiscordWebhook.execute(webhookUrl, utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); if (sender != null) { sender.sendMessage(ChatColor.GREEN + "Message: " + name + ", was sent!"); } From bd24b2aed57ee860e46e2bcba8081de02f079f88 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:09:02 -0500 Subject: [PATCH 15/31] Separates handling into a new class: HandlingService --- .../themistodiscord/HandlingService.java | 63 +++++++++++++++++++ .../xyz/earthcow/themistodiscord/Message.java | 47 +++----------- .../themistodiscord/ThemisListener.java | 18 +++--- 3 files changed, 81 insertions(+), 47 deletions(-) create mode 100644 src/main/java/xyz/earthcow/themistodiscord/HandlingService.java diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java new file mode 100644 index 0000000..7391e35 --- /dev/null +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -0,0 +1,63 @@ +package xyz.earthcow.themistodiscord; + +import com.gmail.olexorus.themis.api.CheckType; +import dev.dejvokep.boostedyaml.block.implementation.Section; +import org.bukkit.entity.Player; + +import java.util.HashMap; +import java.util.UUID; + +public class HandlingService { + private final HashMap> lastSentTimesPerPlayer = new HashMap<>(); + private final HashMap> repetitionCountersPerPlayer = new HashMap<>(); + + private final double executionThreshold; + private final double repetitionDelay; + private final double repetitionThreshold; + + public HandlingService(Section handlingSection) { + this.executionThreshold = handlingSection.getDouble("execution-threshold"); + this.repetitionDelay = handlingSection.getDouble("repetition-delay"); + this.repetitionThreshold = handlingSection.getDouble("repetition-threshold"); + } + + public double getExecutionThreshold() { + return executionThreshold; + } + + public double getRepetitionDelay() { + return repetitionDelay; + } + + public double getRepetitionThreshold() { + return repetitionThreshold; + } + + public long getLastSentTimeForPlayer(Player player, CheckType checkType) { + HashMap times = lastSentTimesPerPlayer.get(player.getUniqueId()); + if (times == null) { + return 0; + } + return times.getOrDefault(checkType, 0L); + } + + public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { + HashMap times = lastSentTimesPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); + times.put(checkType, System.currentTimeMillis()); + lastSentTimesPerPlayer.put(player.getUniqueId(), times); + } + + public int getRepetitionCountForPlayer(Player player, CheckType checkType) { + HashMap repetitionCounts = repetitionCountersPerPlayer.get(player.getUniqueId()); + if (repetitionCounts == null) { + return -2; + } + return repetitionCounts.getOrDefault(checkType, -2); + } + + public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { + HashMap repetitionCounts = repetitionCountersPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); + repetitionCounts.put(checkType, repetitionCount); + repetitionCountersPerPlayer.put(player.getUniqueId(), repetitionCounts); + } +} diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 704a13f..7d03386 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -1,6 +1,5 @@ package xyz.earthcow.themistodiscord; -import com.gmail.olexorus.themis.api.CheckType; import dev.dejvokep.boostedyaml.block.implementation.Section; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -33,11 +32,7 @@ public class Message { private final String webhookJson; @Nullable - private final Section handling; - - // For use with handling - private final HashMap> lastSentTimesPerPlayer = new HashMap<>(); - private final HashMap> repetitionCountersPerPlayer = new HashMap<>(); + private final HandlingService handling; private final ExecutorService executor = Executors.newSingleThreadExecutor(); @@ -72,9 +67,13 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect this.webhookJson = getJsonWebhook(); } - // Define the handling section - this.handling = message.getSection("Handling", null); - + // Define the handling service + Section handlingSection = message.getSection("Handling", null); + if (handlingSection != null && handlingSection.getBoolean("Enabled", false)) { + this.handling = new HandlingService(handlingSection); + } else { + this.handling = null; + } } private String getJsonWebhook() { @@ -240,7 +239,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl return name; } - public @Nullable Section getHandling() { + public @Nullable HandlingService getHandlingService() { return handling; } @@ -252,32 +251,4 @@ public void forceExecutorShutdown() { } } - public long getLastSentTimeForPlayer(Player player, CheckType checkType) { - HashMap times = lastSentTimesPerPlayer.get(player.getUniqueId()); - if (times == null) { - return 0; - } - return times.getOrDefault(checkType, 0L); - } - - public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { - HashMap times = lastSentTimesPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); - times.put(checkType, System.currentTimeMillis()); - lastSentTimesPerPlayer.put(player.getUniqueId(), times); - } - - public int getRepetitionCountForPlayer(Player player, CheckType checkType) { - HashMap repetitionCounts = repetitionCountersPerPlayer.get(player.getUniqueId()); - if (repetitionCounts == null) { - return -2; - } - return repetitionCounts.getOrDefault(checkType, -2); - } - - public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { - HashMap repetitionCounts = repetitionCountersPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); - repetitionCounts.put(checkType, repetitionCount); - repetitionCountersPerPlayer.put(player.getUniqueId(), repetitionCounts); - } - } diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java index 6d928b8..1f5050f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java @@ -40,29 +40,29 @@ public void onViolationEvent(@NotNull ViolationEvent event) { double score = Math.round(ThemisApi.getViolationScore(player, checkType) * 100.0) / 100.0; for (Message message : config.getMessages()) { - Section handling = message.getHandling(); + HandlingService handling = message.getHandlingService(); - if (handling == null || !handling.getBoolean("Enabled", false)) { + if (handling == null) { continue; } - if (handling.getDouble("execution-threshold") > score - || handling.getDouble("repetition-delay") > ((System.currentTimeMillis() - message.getLastSentTimeForPlayer(player, checkType)) / 1000.0)) + if (handling.getExecutionThreshold() > score + || handling.getRepetitionDelay() > ((System.currentTimeMillis() - handling.getLastSentTimeForPlayer(player, checkType)) / 1000.0)) continue; - int repetitionCounterForCheckType = message.getRepetitionCountForPlayer(player, checkType) + 1; + int repetitionCounterForCheckType = handling.getRepetitionCountForPlayer(player, checkType) + 1; - if (repetitionCounterForCheckType == handling.getDouble("repetition-threshold")) { - message.putRepetitionCountForPlayer(player, checkType, -1); + if (repetitionCounterForCheckType == handling.getRepetitionThreshold()) { + handling.putRepetitionCountForPlayer(player, checkType, -1); repetitionCounterForCheckType = -1; } else { - message.putRepetitionCountForPlayer(player, checkType, repetitionCounterForCheckType); + handling.putRepetitionCountForPlayer(player, checkType, repetitionCounterForCheckType); } if (repetitionCounterForCheckType != -1) continue; message.execute(player, checkType.getDescription(), score, ping, tps, null); - message.updateLastSentTimeForPlayer(player, checkType); + handling.updateLastSentTimeForPlayer(player, checkType); } } } \ No newline at end of file From 47ad5179480ab22197ed9420d73e024a6e7e27a4 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:14:35 -0500 Subject: [PATCH 16/31] Generic Map definition in case Map class changes --- .../earthcow/themistodiscord/HandlingService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 7391e35..94bb675 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -5,11 +5,12 @@ import org.bukkit.entity.Player; import java.util.HashMap; +import java.util.Map; import java.util.UUID; public class HandlingService { - private final HashMap> lastSentTimesPerPlayer = new HashMap<>(); - private final HashMap> repetitionCountersPerPlayer = new HashMap<>(); + private final Map> lastSentTimesPerPlayer = new HashMap<>(); + private final Map> repetitionCountersPerPlayer = new HashMap<>(); private final double executionThreshold; private final double repetitionDelay; @@ -34,7 +35,7 @@ public double getRepetitionThreshold() { } public long getLastSentTimeForPlayer(Player player, CheckType checkType) { - HashMap times = lastSentTimesPerPlayer.get(player.getUniqueId()); + Map times = lastSentTimesPerPlayer.get(player.getUniqueId()); if (times == null) { return 0; } @@ -42,13 +43,13 @@ public long getLastSentTimeForPlayer(Player player, CheckType checkType) { } public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { - HashMap times = lastSentTimesPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); + Map times = lastSentTimesPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); times.put(checkType, System.currentTimeMillis()); lastSentTimesPerPlayer.put(player.getUniqueId(), times); } public int getRepetitionCountForPlayer(Player player, CheckType checkType) { - HashMap repetitionCounts = repetitionCountersPerPlayer.get(player.getUniqueId()); + Map repetitionCounts = repetitionCountersPerPlayer.get(player.getUniqueId()); if (repetitionCounts == null) { return -2; } @@ -56,7 +57,7 @@ public int getRepetitionCountForPlayer(Player player, CheckType checkType) { } public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { - HashMap repetitionCounts = repetitionCountersPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); + Map repetitionCounts = repetitionCountersPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); repetitionCounts.put(checkType, repetitionCount); repetitionCountersPerPlayer.put(player.getUniqueId(), repetitionCounts); } From 15d0b2ca1422d9229388f947248548019d56d9ab Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:39:10 -0500 Subject: [PATCH 17/31] Replaces the handling map of maps with a map of records --- .../themistodiscord/HandlingService.java | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 94bb675..746e940 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -6,11 +6,11 @@ import java.util.HashMap; import java.util.Map; -import java.util.UUID; public class HandlingService { - private final Map> lastSentTimesPerPlayer = new HashMap<>(); - private final Map> repetitionCountersPerPlayer = new HashMap<>(); + private record CheckData(long lastSent, int repetitionCount) {} + + private final Map playerCheckData = new HashMap<>(); private final double executionThreshold; private final double repetitionDelay; @@ -34,31 +34,41 @@ public double getRepetitionThreshold() { return repetitionThreshold; } + private String getPlayerCheckDataKey(Player player, CheckType checkType) { + return player.getUniqueId() + ":" + checkType.name(); + } + public long getLastSentTimeForPlayer(Player player, CheckType checkType) { - Map times = lastSentTimesPerPlayer.get(player.getUniqueId()); - if (times == null) { - return 0; - } - return times.getOrDefault(checkType, 0L); + CheckData checkData = playerCheckData.get(getPlayerCheckDataKey(player, checkType)); + if (checkData == null) return 0; + return checkData.lastSent; } public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { - Map times = lastSentTimesPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); - times.put(checkType, System.currentTimeMillis()); - lastSentTimesPerPlayer.put(player.getUniqueId(), times); + String playerCheckDataKey = getPlayerCheckDataKey(player, checkType); + CheckData checkData = playerCheckData.get(playerCheckDataKey); + if (checkData == null) { + checkData = new CheckData(System.currentTimeMillis(), -2); + } else { + checkData = new CheckData(System.currentTimeMillis(), checkData.repetitionCount); + } + playerCheckData.put(playerCheckDataKey, checkData); } public int getRepetitionCountForPlayer(Player player, CheckType checkType) { - Map repetitionCounts = repetitionCountersPerPlayer.get(player.getUniqueId()); - if (repetitionCounts == null) { - return -2; - } - return repetitionCounts.getOrDefault(checkType, -2); + CheckData checkData = playerCheckData.get(getPlayerCheckDataKey(player, checkType)); + if (checkData == null) return -2; + return checkData.repetitionCount; } public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { - Map repetitionCounts = repetitionCountersPerPlayer.getOrDefault(player.getUniqueId(), new HashMap<>()); - repetitionCounts.put(checkType, repetitionCount); - repetitionCountersPerPlayer.put(player.getUniqueId(), repetitionCounts); + String playerCheckDataKey = getPlayerCheckDataKey(player, checkType); + CheckData checkData = playerCheckData.get(playerCheckDataKey); + if (checkData == null) { + checkData = new CheckData(0, repetitionCount); + } else { + checkData = new CheckData(checkData.lastSent, repetitionCount); + } + playerCheckData.put(playerCheckDataKey, checkData); } } From 03d2ecc00fe7da4e3326df983cf303d348b7e01f Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:45:58 -0500 Subject: [PATCH 18/31] Implements a record key to avoid repetitive string concatenation --- .../themistodiscord/HandlingService.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 746e940..ec32efb 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -6,11 +6,13 @@ import java.util.HashMap; import java.util.Map; +import java.util.UUID; public class HandlingService { + private record CheckKey(UUID uuid, CheckType checkType) {} private record CheckData(long lastSent, int repetitionCount) {} - private final Map playerCheckData = new HashMap<>(); + private final Map playerCheckData = new HashMap<>(); private final double executionThreshold; private final double repetitionDelay; @@ -34,18 +36,14 @@ public double getRepetitionThreshold() { return repetitionThreshold; } - private String getPlayerCheckDataKey(Player player, CheckType checkType) { - return player.getUniqueId() + ":" + checkType.name(); - } - public long getLastSentTimeForPlayer(Player player, CheckType checkType) { - CheckData checkData = playerCheckData.get(getPlayerCheckDataKey(player, checkType)); + CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); if (checkData == null) return 0; return checkData.lastSent; } public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { - String playerCheckDataKey = getPlayerCheckDataKey(player, checkType); + CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); CheckData checkData = playerCheckData.get(playerCheckDataKey); if (checkData == null) { checkData = new CheckData(System.currentTimeMillis(), -2); @@ -56,13 +54,13 @@ public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { } public int getRepetitionCountForPlayer(Player player, CheckType checkType) { - CheckData checkData = playerCheckData.get(getPlayerCheckDataKey(player, checkType)); + CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); if (checkData == null) return -2; return checkData.repetitionCount; } public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { - String playerCheckDataKey = getPlayerCheckDataKey(player, checkType); + CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); CheckData checkData = playerCheckData.get(playerCheckDataKey); if (checkData == null) { checkData = new CheckData(0, repetitionCount); From 2310075d895dd82d55b6a4b254515f02b3ca3253 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:49:55 -0500 Subject: [PATCH 19/31] Adds constants to remove magic numbers --- .../xyz/earthcow/themistodiscord/HandlingService.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index ec32efb..99a8f1f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -18,6 +18,9 @@ private record CheckData(long lastSent, int repetitionCount) {} private final double repetitionDelay; private final double repetitionThreshold; + private static final long DEFAULT_LAST_SENT = 0; + private static final int DEFAULT_REPETITION_COUNT = -2; + public HandlingService(Section handlingSection) { this.executionThreshold = handlingSection.getDouble("execution-threshold"); this.repetitionDelay = handlingSection.getDouble("repetition-delay"); @@ -38,7 +41,7 @@ public double getRepetitionThreshold() { public long getLastSentTimeForPlayer(Player player, CheckType checkType) { CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); - if (checkData == null) return 0; + if (checkData == null) return DEFAULT_LAST_SENT; return checkData.lastSent; } @@ -46,7 +49,7 @@ public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); CheckData checkData = playerCheckData.get(playerCheckDataKey); if (checkData == null) { - checkData = new CheckData(System.currentTimeMillis(), -2); + checkData = new CheckData(System.currentTimeMillis(), DEFAULT_REPETITION_COUNT); } else { checkData = new CheckData(System.currentTimeMillis(), checkData.repetitionCount); } @@ -55,7 +58,7 @@ public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { public int getRepetitionCountForPlayer(Player player, CheckType checkType) { CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); - if (checkData == null) return -2; + if (checkData == null) return DEFAULT_REPETITION_COUNT; return checkData.repetitionCount; } @@ -63,7 +66,7 @@ public void putRepetitionCountForPlayer(Player player, CheckType checkType, int CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); CheckData checkData = playerCheckData.get(playerCheckDataKey); if (checkData == null) { - checkData = new CheckData(0, repetitionCount); + checkData = new CheckData(DEFAULT_LAST_SENT, repetitionCount); } else { checkData = new CheckData(checkData.lastSent, repetitionCount); } From 74428e859c90a6bf27804ddac70e20c2261c913b Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:04:20 -0500 Subject: [PATCH 20/31] Uses Google Guava Cache to remove inactive records --- .../themistodiscord/HandlingService.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 99a8f1f..6e07e45 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -1,18 +1,19 @@ package xyz.earthcow.themistodiscord; import com.gmail.olexorus.themis.api.CheckType; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; import dev.dejvokep.boostedyaml.block.implementation.Section; import org.bukkit.entity.Player; -import java.util.HashMap; -import java.util.Map; import java.util.UUID; +import java.util.concurrent.TimeUnit; public class HandlingService { private record CheckKey(UUID uuid, CheckType checkType) {} private record CheckData(long lastSent, int repetitionCount) {} - private final Map playerCheckData = new HashMap<>(); + private final Cache playerCheckData; private final double executionThreshold; private final double repetitionDelay; @@ -25,6 +26,10 @@ public HandlingService(Section handlingSection) { this.executionThreshold = handlingSection.getDouble("execution-threshold"); this.repetitionDelay = handlingSection.getDouble("repetition-delay"); this.repetitionThreshold = handlingSection.getDouble("repetition-threshold"); + + this.playerCheckData = CacheBuilder.newBuilder() + .expireAfterAccess(24, TimeUnit.HOURS) + .build(); } public double getExecutionThreshold() { @@ -40,14 +45,14 @@ public double getRepetitionThreshold() { } public long getLastSentTimeForPlayer(Player player, CheckType checkType) { - CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); + CheckData checkData = playerCheckData.getIfPresent(new CheckKey(player.getUniqueId(), checkType)); if (checkData == null) return DEFAULT_LAST_SENT; return checkData.lastSent; } public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); - CheckData checkData = playerCheckData.get(playerCheckDataKey); + CheckData checkData = playerCheckData.getIfPresent(playerCheckDataKey); if (checkData == null) { checkData = new CheckData(System.currentTimeMillis(), DEFAULT_REPETITION_COUNT); } else { @@ -57,14 +62,14 @@ public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { } public int getRepetitionCountForPlayer(Player player, CheckType checkType) { - CheckData checkData = playerCheckData.get(new CheckKey(player.getUniqueId(), checkType)); + CheckData checkData = playerCheckData.getIfPresent(new CheckKey(player.getUniqueId(), checkType)); if (checkData == null) return DEFAULT_REPETITION_COUNT; return checkData.repetitionCount; } public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); - CheckData checkData = playerCheckData.get(playerCheckDataKey); + CheckData checkData = playerCheckData.getIfPresent(playerCheckDataKey); if (checkData == null) { checkData = new CheckData(DEFAULT_LAST_SENT, repetitionCount); } else { From 24c945a34858f8db7ed12b11d26255a154c25033 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:19:16 -0500 Subject: [PATCH 21/31] Handling configuration validation --- .../themistodiscord/HandlingService.java | 24 +++++++++++++++---- .../xyz/earthcow/themistodiscord/Message.java | 4 ++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 6e07e45..194d19b 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -5,6 +5,7 @@ import com.google.common.cache.CacheBuilder; import dev.dejvokep.boostedyaml.block.implementation.Section; import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; import java.util.UUID; import java.util.concurrent.TimeUnit; @@ -22,10 +23,25 @@ private record CheckData(long lastSent, int repetitionCount) {} private static final long DEFAULT_LAST_SENT = 0; private static final int DEFAULT_REPETITION_COUNT = -2; - public HandlingService(Section handlingSection) { - this.executionThreshold = handlingSection.getDouble("execution-threshold"); - this.repetitionDelay = handlingSection.getDouble("repetition-delay"); - this.repetitionThreshold = handlingSection.getDouble("repetition-threshold"); + public HandlingService(@NotNull Section handlingSection, @NotNull String msgName, @NotNull ThemisToDiscord ttd) { + double localExecutionThreshold = handlingSection.getDouble("execution-threshold"); + double localRepetitionDelay = handlingSection.getDouble("repetition-delay"); + double localRepetitionThreshold = handlingSection.getDouble("repetition-threshold"); + if (localExecutionThreshold < 1) { + ttd.log(LogLevel.WARN, "Execution threshold must be positive! Message: " + msgName + " will use the default of 10.0"); + localExecutionThreshold = 10.0; + } + if (localRepetitionDelay < 1 || localRepetitionDelay >= 86400) { + ttd.log(LogLevel.WARN, "Repetition delay must be positive and less than 24 hours! Message: " + msgName + " will use the default of 10.0"); + localRepetitionDelay = 10.0; + } + if (localRepetitionThreshold < 1) { + ttd.log(LogLevel.WARN, "Repetition threshold must be positive! Message: " + msgName + " will use the default of 5.0"); + localRepetitionThreshold = 5.0; + } + this.executionThreshold = localExecutionThreshold; + this.repetitionDelay = localRepetitionDelay; + this.repetitionThreshold = localRepetitionThreshold; this.playerCheckData = CacheBuilder.newBuilder() .expireAfterAccess(24, TimeUnit.HOURS) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 7d03386..39d2f78 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -41,7 +41,7 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect this.utils = utils; this.message = message; - this.name = message.getNameAsString(); + this.name = Objects.requireNonNull(message.getNameAsString()); // Discover the webhook url to be used String localWebhookUrl; @@ -70,7 +70,7 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect // Define the handling service Section handlingSection = message.getSection("Handling", null); if (handlingSection != null && handlingSection.getBoolean("Enabled", false)) { - this.handling = new HandlingService(handlingSection); + this.handling = new HandlingService(handlingSection, name, ttd); } else { this.handling = null; } From f1739eda957bd4f7de2b359e6255a8ef36bf63b8 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:32:37 -0500 Subject: [PATCH 22/31] Improves handling logic & ensures repetition-threshold is a double --- .../themistodiscord/HandlingService.java | 10 +++++----- .../themistodiscord/ThemisListener.java | 19 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java index 194d19b..5d806b5 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java +++ b/src/main/java/xyz/earthcow/themistodiscord/HandlingService.java @@ -12,7 +12,7 @@ public class HandlingService { private record CheckKey(UUID uuid, CheckType checkType) {} - private record CheckData(long lastSent, int repetitionCount) {} + private record CheckData(long lastSent, double repetitionCount) {} private final Cache playerCheckData; @@ -20,8 +20,8 @@ private record CheckData(long lastSent, int repetitionCount) {} private final double repetitionDelay; private final double repetitionThreshold; - private static final long DEFAULT_LAST_SENT = 0; - private static final int DEFAULT_REPETITION_COUNT = -2; + private static final long DEFAULT_LAST_SENT = 0L; + private static final double DEFAULT_REPETITION_COUNT = 0.0; public HandlingService(@NotNull Section handlingSection, @NotNull String msgName, @NotNull ThemisToDiscord ttd) { double localExecutionThreshold = handlingSection.getDouble("execution-threshold"); @@ -77,13 +77,13 @@ public void updateLastSentTimeForPlayer(Player player, CheckType checkType) { playerCheckData.put(playerCheckDataKey, checkData); } - public int getRepetitionCountForPlayer(Player player, CheckType checkType) { + public double getRepetitionCountForPlayer(Player player, CheckType checkType) { CheckData checkData = playerCheckData.getIfPresent(new CheckKey(player.getUniqueId(), checkType)); if (checkData == null) return DEFAULT_REPETITION_COUNT; return checkData.repetitionCount; } - public void putRepetitionCountForPlayer(Player player, CheckType checkType, int repetitionCount) { + public void putRepetitionCountForPlayer(Player player, CheckType checkType, double repetitionCount) { CheckKey playerCheckDataKey = new CheckKey(player.getUniqueId(), checkType); CheckData checkData = playerCheckData.getIfPresent(playerCheckDataKey); if (checkData == null) { diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java index 1f5050f..6a67ace 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java @@ -50,19 +50,18 @@ public void onViolationEvent(@NotNull ViolationEvent event) { || handling.getRepetitionDelay() > ((System.currentTimeMillis() - handling.getLastSentTimeForPlayer(player, checkType)) / 1000.0)) continue; - int repetitionCounterForCheckType = handling.getRepetitionCountForPlayer(player, checkType) + 1; + double currentRepCount = handling.getRepetitionCountForPlayer(player, checkType) + 1.0; - if (repetitionCounterForCheckType == handling.getRepetitionThreshold()) { - handling.putRepetitionCountForPlayer(player, checkType, -1); - repetitionCounterForCheckType = -1; + if (currentRepCount >= handling.getRepetitionThreshold()) { + message.execute(player, checkType.getDescription(), score, ping, tps, null); + handling.updateLastSentTimeForPlayer(player, checkType); + + // Reset the counter + handling.putRepetitionCountForPlayer(player, checkType, 0); } else { - handling.putRepetitionCountForPlayer(player, checkType, repetitionCounterForCheckType); + // Update the counter + handling.putRepetitionCountForPlayer(player, checkType, currentRepCount); } - - if (repetitionCounterForCheckType != -1) continue; - - message.execute(player, checkType.getDescription(), score, ping, tps, null); - handling.updateLastSentTimeForPlayer(player, checkType); } } } \ No newline at end of file From 71e3d604e97c8b3e1c9473c6a6a90a64fb0c53dc Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 18:37:45 -0500 Subject: [PATCH 23/31] Shuts down executor threads when the plugin is disabled --- .../xyz/earthcow/themistodiscord/ThemisToDiscord.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java index 2a76f3f..5cf6209 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java @@ -26,7 +26,13 @@ public void onEnable() { } @Override - public void onDisable() {} + public void onDisable() { + if (config != null) { + for (Message message : config.getMessages()) { + message.forceExecutorShutdown(); + } + } + } public void log(String message) { getLogger().info(message); From 2aeba80206ad5671955960823ccc577e196341cd Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:23:05 -0500 Subject: [PATCH 24/31] Adds bStats metrics --- build.gradle.kts | 2 ++ gradle/libs.versions.toml | 2 ++ .../java/xyz/earthcow/themistodiscord/ThemisToDiscord.java | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index fb1386c..b594dd8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,7 @@ repositories { dependencies { implementation(libs.dev.dejvokep.boosted.yaml) implementation(libs.com.github.earthcow.javadiscordwebhook) + implementation(libs.org.bstats.bstats.api) compileOnly(files("libs/ThemisAPI.jar")) compileOnly(libs.org.spigotmc.spigot.api) @@ -53,6 +54,7 @@ tasks.shadowJar { archiveClassifier.set("") // Relocate shaded dependencies to internal libs directory relocate("dev.dejvokep.boostedyaml", "xyz.earthcow.themistodiscord.libs.boostedyaml") + relocate("org.bstats", "xyz.earthcow.themistodiscord.libs.bstats") // Exclude annotation packages from the uber jar file exclude("org/intellij/**", "org/jetbrains/**") } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 838097b..e3f1514 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,7 @@ dev-dejvokep-boosted-yaml = "1.3.7" org-geysermc-floodgate-api = "2.2.4-SNAPSHOT" org-jetbrains-annotations = "24.1.0" org-spigotmc-spigot-api = "1.17-R0.1-SNAPSHOT" +org-bstats-bstats-api = "3.1.0" [libraries] com-github-earthcow-javadiscordwebhook = { module = "com.github.EarthCow:JavaDiscordWebhook", version.ref = "com-github-earthcow-javadiscordwebhook" } @@ -14,3 +15,4 @@ dev-dejvokep-boosted-yaml = { module = "dev.dejvokep:boosted-yaml", version.ref org-geysermc-floodgate-api = { module = "org.geysermc.floodgate:api", version.ref = "org-geysermc-floodgate-api" } org-jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "org-jetbrains-annotations" } org-spigotmc-spigot-api = { module = "org.spigotmc:spigot-api", version.ref = "org-spigotmc-spigot-api" } +org-bstats-bstats-api = { module = "org.bstats:bstats-bukkit", version.ref = "org-bstats-bstats-api" } diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java index 5cf6209..01a102b 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisToDiscord.java @@ -1,5 +1,7 @@ package xyz.earthcow.themistodiscord; +import org.bstats.bukkit.Metrics; +import org.bstats.charts.SimplePie; import org.bukkit.plugin.java.JavaPlugin; import java.io.IOException; @@ -23,6 +25,10 @@ public void onEnable() { Objects.requireNonNull(getCommand("ttd")).setTabCompleter(ttdCommand); getServer().getPluginManager().registerEvents(new ThemisListener(this, config), this); + + int pluginId = 28743; + Metrics metrics = new Metrics(this, pluginId); + metrics.addCustomChart(new SimplePie("message_count", () -> String.valueOf(config.getMessages().size()))); } @Override From e672c1e8b151c99141ce6899b838b343ae432c1d Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:57:05 -0500 Subject: [PATCH 25/31] Bump to version 0.3.1 --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index b594dd8..411e2a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -26,7 +26,7 @@ dependencies { } group = "xyz.earthcow" -version = "0.3.0" +version = "0.3.1" tasks.withType() { options.encoding = "UTF-8" From 9cc9fe14b741abc553048193fedd74bd8948e68e Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:18:41 -0500 Subject: [PATCH 26/31] Adds a warning msg when color parsing fails --- src/main/java/xyz/earthcow/themistodiscord/Utils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 3774d83..9d312e4 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -8,12 +8,15 @@ import xyz.earthcow.discordwebhook.DiscordWebhook; public class Utils { + @NotNull + private ThemisToDiscord ttd; @Nullable private FloodgateApi floodgateApi; @NotNull private final YamlDocument config; public Utils(@NotNull ThemisToDiscord ttd, @NotNull YamlDocument configDocument) { + this.ttd = ttd; if (ttd.getServer().getPluginManager().isPluginEnabled("Floodgate")) { ttd.log("Found Floodgate! Enabling features..."); floodgateApi = FloodgateApi.getInstance(); @@ -66,6 +69,8 @@ private Integer hexToInteger(String hex) { try { return Integer.parseInt(hex.replace("#", ""), 16); } catch (NumberFormatException e) { + ttd.log(LogLevel.WARN, "Invalid color string: " + hex + ". Using black."); + ttd.log(LogLevel.DEBUG, "Exception: " + e); return 0; } } From 9b90cb958bb7c115ce8a35997b020fcd65cc5660 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:03:30 -0500 Subject: [PATCH 27/31] Lessens Message method complexity --- .../earthcow/themistodiscord/EmbedUtil.java | 78 ++++++++ .../xyz/earthcow/themistodiscord/Message.java | 171 ++++++------------ 2 files changed, 138 insertions(+), 111 deletions(-) create mode 100644 src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java diff --git a/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java b/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java new file mode 100644 index 0000000..4eb308d --- /dev/null +++ b/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java @@ -0,0 +1,78 @@ +package xyz.earthcow.themistodiscord; + +import dev.dejvokep.boostedyaml.block.implementation.Section; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import xyz.earthcow.discordwebhook.DiscordWebhook; + +import java.awt.Color; +import java.util.List; + +public class EmbedUtil { + + public static void applyColor(@NotNull DiscordWebhook.EmbedObject embed, @NotNull String color, @NotNull ThemisToDiscord ttd, @NotNull String msgName) { + if (color.contains("%category_color%")) { + embed.setColorStr(color); + } else { + try { + embed.setColor( + Color.decode(color) + ); + } catch (NumberFormatException e) { + ttd.log(LogLevel.WARN, "Invalid color string: " + color + " for message: " + msgName + ". Using black."); + ttd.log(LogLevel.DEBUG, "Exception: " + e); + embed.setColor(Color.BLACK); + } + } + } + + public static void applyAuthor(@NotNull DiscordWebhook.EmbedObject embed, @Nullable Section section) { + if (section != null) { + embed.setAuthor( + section.getString("Name"), + section.getString("Url"), + section.getString("ImageUrl") + ); + } + } + + public static void applyTitle(@NotNull DiscordWebhook.EmbedObject embed, @Nullable Section section) { + if (section != null) { + embed.setTitle(section.getString("Text")); + embed.setUrl(section.getString("Url")); + } + } + + public static void applyFields(@NotNull DiscordWebhook.EmbedObject embed, @NotNull List fields) { + if (!fields.isEmpty()) { + + for (String field : fields) { + if (field.contains(";")) { + + String[] parts = field.split(";"); + if (parts.length < 2) { + continue; + } + + boolean inline = parts.length < 3 || Boolean.parseBoolean(parts[2]); + + embed.addField(parts[0], parts[1], inline); + } else { + boolean inline = Boolean.parseBoolean(field); + embed.addField("\u200e", "\u200e", inline); + } + } + + } + } + + public static void applyFooter(@NotNull DiscordWebhook.EmbedObject embed, @Nullable Section section) { + if (section != null) { + embed.setFooter( + section.getString("Text"), + section.getString("IconUrl") + ); + } + } + +} diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 39d2f78..823cff9 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -12,7 +12,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.*; -import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -43,21 +42,7 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect this.message = message; this.name = Objects.requireNonNull(message.getNameAsString()); - // Discover the webhook url to be used - String localWebhookUrl; - if (message.getBoolean("CustomWebhook.Enabled", false)) { - localWebhookUrl = message.getString("CustomWebhook.Url", ""); - if (Utils.isInvalidWebhookUrl(localWebhookUrl)) { - if (!localWebhookUrl.isEmpty()) { - ttd.log(LogLevel.WARN, "Invalid custom webhook url for message: " + name + "! This message will use the global webhook url."); - } - localWebhookUrl = message.getRoot().getString("webhookUrl"); - } - } else { - localWebhookUrl = message.getRoot().getString("webhookUrl"); - } - // Set the webhook url for this message - this.webhookUrl = localWebhookUrl; + this.webhookUrl = determineWebhookUrl(); // Determine and set the webhook json String jsonString = message.getString("Json", ""); @@ -76,6 +61,22 @@ public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Sect } } + private String determineWebhookUrl() { + String localWebhookUrl; + if (message.getBoolean("CustomWebhook.Enabled", false)) { + localWebhookUrl = message.getString("CustomWebhook.Url", ""); + if (Utils.isInvalidWebhookUrl(localWebhookUrl)) { + if (!localWebhookUrl.isEmpty()) { + ttd.log(LogLevel.WARN, "Invalid custom webhook url for message: " + name + "! This message will use the global webhook url."); + } + localWebhookUrl = message.getRoot().getString("webhookUrl"); + } + } else { + localWebhookUrl = message.getRoot().getString("webhookUrl"); + } + return localWebhookUrl; + } + private String getJsonWebhook() { DiscordWebhook webhook = new DiscordWebhook(); @@ -93,87 +94,37 @@ private String getJsonWebhook() { return webhook.getJsonString(); } + webhook.addEmbed(getEmbedFromConfig(embedSection)); + return webhook.getJsonString(); + } + + private DiscordWebhook.EmbedObject getEmbedFromConfig(@NotNull Section embedSection) { // Define the embed object DiscordWebhook.EmbedObject embed = new DiscordWebhook.EmbedObject(); // Set the color - String colorStr = embedSection.getString("Color", ""); - if (colorStr.contains("%category_color%")) { - embed.setColorStr(colorStr); - } else { - try { - embed.setColor( - Color.decode(colorStr) - ); - } catch (NumberFormatException e) { - ttd.log(LogLevel.WARN, "Invalid color string: " + colorStr + " for message: " + name + ". Using black."); - ttd.log(LogLevel.DEBUG, "Exception: " + e); - embed.setColor(Color.BLACK); - } - } - + EmbedUtil.applyColor(embed, embedSection.getString("Color", ""), ttd, name); // Set the author - if (embedSection.get("Author", null) != null) { - embed.setAuthor( - embedSection.getString("Author.Name"), - embedSection.getString("Author.Url"), - embedSection.getString("Author.ImageUrl") - ); - } - + EmbedUtil.applyAuthor(embed, embedSection.getSection("Author")); // Set the thumbnail url - embed.setThumbnail(embedSection.getString("ThumbnailUrl", null)); - + embed.setThumbnail(embedSection.getString("ThumbnailUrl")); // Set the title - if (embedSection.get("Title", null) != null) { - embed.setTitle(embedSection.getString("Title.Text", null)); - embed.setUrl(embedSection.getString("Title.Url", null)); - } - + EmbedUtil.applyTitle(embed, embedSection.getSection("Title")); // Set the description - embed.setDescription(embedSection.getString("Description", null)); - + embed.setDescription(embedSection.getString("Description")); // Set the fields - List fields = embedSection.getStringList("Fields"); - if (!fields.isEmpty()) { - - for (String field : fields) { - if (field.contains(";")) { - - String[] parts = field.split(";"); - if (parts.length < 2) { - continue; - } - - boolean inline = parts.length < 3 || Boolean.parseBoolean(parts[2]); - - embed.addField(parts[0], parts[1], inline); - } else { - boolean inline = Boolean.parseBoolean(field); - embed.addField("\u200e", "\u200e", inline); - } - } - - } - + EmbedUtil.applyFields(embed, embedSection.getStringList("Fields")); // Set the image url - embed.setImage(embedSection.getString("ImageUrl", null)); - + embed.setImage(embedSection.getString("ImageUrl")); // Set the footer - if (embedSection.get("Footer", null) != null) { - embed.setFooter( - embedSection.getString("Footer.Text", null), - embedSection.getString("Footer.IconUrl", null) - ); - } + EmbedUtil.applyFooter(embed, embedSection.getSection("Footer")); // Set the timestamp if (embedSection.getBoolean("Timestamp")) { embed.setTimestamp((new Date()).toInstant()); } - webhook.addEmbed(embed); - return webhook.getJsonString(); + return embed; } public void execute(@NotNull Player player, @NotNull String detectionType, double score, double ping, double tps, @Nullable CommandSender sender) { @@ -189,37 +140,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl if (e instanceof FileNotFoundException) { msg = "Your webhook url is not valid! Update it with /ttd url !"; } else { - String message = e.getMessage(); - if (message != null && message.contains("HTTP response code:")) { - try { - int responseCode = Integer.parseInt(message.substring(message.indexOf(":") + 2, message.indexOf(":") + 5)); - switch (responseCode) { - case 400: - msg = "Error - 400 response - bad request. Verify all urls are either blank or valid urls."; - break; - case 401: - msg = "Error - 401 response - unauthorized. Verify webhook url and discord server status."; - break; - case 403: - msg = "Error - 403 response - forbidden. Verify webhook url and discord server status."; - break; - case 404: - msg = "Error - 404 response - not found. Verify webhook url and discord server status."; - break; - case 429: - msg = "Error - 429 response - too many requests. This webhook has sent too many messages in too short amount of time."; - break; - case 500: - msg = "Error - 505 response - internal server error. Discord services may be temporarily down."; - break; - default: - msg = "Error - " + responseCode + " response - unexpected error code."; - break; - } - } catch (IndexOutOfBoundsException | NumberFormatException ex) { - ttd.log(LogLevel.DEBUG, "Secondary exception: " + ex); - } - } + msg = getHttpErrorMsg(e.getMessage()); } if (msg == null) { msg = "Unknown error has occurred. Please make a bug report at https://github.com/RagingTech/ThemisToDiscord/issues."; @@ -235,6 +156,34 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl }); } + @Nullable + private String getHttpErrorMsg(@Nullable String message) { + String msg = null; + if (message != null && message.contains("HTTP response code:")) { + try { + int responseCode = Integer.parseInt(message.substring(message.indexOf(":") + 2, message.indexOf(":") + 5)); + msg = switch (responseCode) { + case 400 -> + "Error - 400 response - bad request. Verify all urls are either blank or valid urls."; + case 401 -> + "Error - 401 response - unauthorized. Verify webhook url and discord server status."; + case 403 -> + "Error - 403 response - forbidden. Verify webhook url and discord server status."; + case 404 -> + "Error - 404 response - not found. Verify webhook url and discord server status."; + case 429 -> + "Error - 429 response - too many requests. This webhook has sent too many messages in too short amount of time."; + case 500 -> + "Error - 505 response - internal server error. Discord services may be temporarily down."; + default -> "Error - " + responseCode + " response - unexpected error code."; + }; + } catch (IndexOutOfBoundsException | NumberFormatException ex) { + ttd.log(LogLevel.DEBUG, "Secondary exception: " + ex); + } + } + return msg; + } + public @NotNull String getName() { return name; } From c5ef29a2aa5952dada93a4cb9ad6ef3cdea7bdb4 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:25:11 -0500 Subject: [PATCH 28/31] Fixes constant timestamp of initialization --- .../java/xyz/earthcow/themistodiscord/Message.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 823cff9..0a723b7 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -11,6 +11,7 @@ import java.awt.*; import java.io.FileNotFoundException; import java.io.IOException; +import java.time.temporal.TemporalAccessor; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -35,6 +36,9 @@ public class Message { private final ExecutorService executor = Executors.newSingleThreadExecutor(); + @Nullable + private String originalTimestamp; + public Message(@NotNull ThemisToDiscord ttd, @NotNull Utils utils, @NotNull Section message) { this.ttd = ttd; this.utils = utils; @@ -121,7 +125,9 @@ private DiscordWebhook.EmbedObject getEmbedFromConfig(@NotNull Section embedSect // Set the timestamp if (embedSection.getBoolean("Timestamp")) { - embed.setTimestamp((new Date()).toInstant()); + TemporalAccessor ta = (new Date()).toInstant(); + embed.setTimestamp(ta); + this.originalTimestamp = ta.toString(); } return embed; @@ -131,7 +137,11 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl // Using a single thread executor ensures messages are not concurrently modified and sent in succession executor.submit(() -> { try { - DiscordWebhook.execute(webhookUrl, utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps)); + String jsonPayload = utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps); + if (originalTimestamp != null) { + jsonPayload = jsonPayload.replace(originalTimestamp, (new Date()).toInstant().toString()); + } + DiscordWebhook.execute(webhookUrl, jsonPayload); if (sender != null) { sender.sendMessage(ChatColor.GREEN + "Message: " + name + ", was sent!"); } From 1ffa57cd28cb48808c64f6559fa69baa40e2241a Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:39:06 -0500 Subject: [PATCH 29/31] Optimizes imports & ensures json payload is not null --- .../java/xyz/earthcow/themistodiscord/EmbedUtil.java | 2 +- .../java/xyz/earthcow/themistodiscord/Message.java | 11 +++++++---- .../xyz/earthcow/themistodiscord/ThemisListener.java | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java b/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java index 4eb308d..93e8d75 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java +++ b/src/main/java/xyz/earthcow/themistodiscord/EmbedUtil.java @@ -5,7 +5,7 @@ import org.jetbrains.annotations.Nullable; import xyz.earthcow.discordwebhook.DiscordWebhook; -import java.awt.Color; +import java.awt.*; import java.util.List; public class EmbedUtil { diff --git a/src/main/java/xyz/earthcow/themistodiscord/Message.java b/src/main/java/xyz/earthcow/themistodiscord/Message.java index 0a723b7..55f101f 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Message.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Message.java @@ -8,11 +8,11 @@ import org.jetbrains.annotations.Nullable; import xyz.earthcow.discordwebhook.DiscordWebhook; -import java.awt.*; import java.io.FileNotFoundException; import java.io.IOException; import java.time.temporal.TemporalAccessor; -import java.util.*; +import java.util.Date; +import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -34,6 +34,7 @@ public class Message { @Nullable private final HandlingService handling; + @NotNull private final ExecutorService executor = Executors.newSingleThreadExecutor(); @Nullable @@ -137,7 +138,9 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl // Using a single thread executor ensures messages are not concurrently modified and sent in succession executor.submit(() -> { try { - String jsonPayload = utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps); + String jsonPayload = Objects.requireNonNull( + utils.handleAllPlaceholders(webhookJson, player, detectionType, score, ping, tps) + ); if (originalTimestamp != null) { jsonPayload = jsonPayload.replace(originalTimestamp, (new Date()).toInstant().toString()); } @@ -146,7 +149,7 @@ public void execute(@NotNull Player player, @NotNull String detectionType, doubl sender.sendMessage(ChatColor.GREEN + "Message: " + name + ", was sent!"); } } catch (IOException e) { - String msg = null; + String msg; if (e instanceof FileNotFoundException) { msg = "Your webhook url is not valid! Update it with /ttd url !"; } else { diff --git a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java index 6a67ace..75c3dfa 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java +++ b/src/main/java/xyz/earthcow/themistodiscord/ThemisListener.java @@ -3,7 +3,6 @@ import com.gmail.olexorus.themis.api.CheckType; import com.gmail.olexorus.themis.api.ThemisApi; import com.gmail.olexorus.themis.api.ViolationEvent; -import dev.dejvokep.boostedyaml.block.implementation.Section; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; From d81ca19ecdcf54fc0e53bcefdea1e55103178e08 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:45:23 -0500 Subject: [PATCH 30/31] Uses an empty string as default to prevent NPE --- gradle/libs.versions.toml | 2 +- src/main/java/xyz/earthcow/themistodiscord/Utils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e3f1514..1a54fc6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format [versions] -com-github-earthcow-javadiscordwebhook = "master-SNAPSHOT" +com-github-earthcow-javadiscordwebhook = "1.3.0" dev-dejvokep-boosted-yaml = "1.3.7" org-geysermc-floodgate-api = "2.2.4-SNAPSHOT" org-jetbrains-annotations = "24.1.0" diff --git a/src/main/java/xyz/earthcow/themistodiscord/Utils.java b/src/main/java/xyz/earthcow/themistodiscord/Utils.java index 9d312e4..a69c868 100644 --- a/src/main/java/xyz/earthcow/themistodiscord/Utils.java +++ b/src/main/java/xyz/earthcow/themistodiscord/Utils.java @@ -59,7 +59,7 @@ public String handleAllPlaceholders( .replace("%player_name%", player.getName()) .replace("%player_uuid%", player.getUniqueId().toString()) .replace("%detection_type%", detectionType) - .replace("%category_color%", hexToInteger(config.getString("categoryColors." + detectionType)).toString()) + .replace("%category_color%", hexToInteger(config.getString("categoryColors." + detectionType, "")).toString()) .replace("%score%", Double.toString(score)) .replace("%ping%", Double.toString(ping)) .replace("%tps%", Double.toString(tps)); From b948b664ae34eb044ed936bf63cebc27155976a0 Mon Sep 17 00:00:00 2001 From: EarthCow <56940983+EarthCow@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:50:52 -0500 Subject: [PATCH 31/31] Uses v1.3.0 of JavaDiscordWebhook instead of building master --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1a54fc6..83e006d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ # https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format [versions] -com-github-earthcow-javadiscordwebhook = "1.3.0" +com-github-earthcow-javadiscordwebhook = "v1.3.0" dev-dejvokep-boosted-yaml = "1.3.7" org-geysermc-floodgate-api = "2.2.4-SNAPSHOT" org-jetbrains-annotations = "24.1.0"