From 9c717fa81830e8c2560ea7d9b072b285ddaccd36 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 19 Mar 2024 18:14:33 +0000 Subject: [PATCH] deps: bump ProfanityCheckerAPI to v3.0 --- common/build.gradle | 4 ++-- .../net/william278/huskchat/filter/ProfanityFilterer.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index e6fc43a..9562a47 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -5,7 +5,7 @@ plugins { dependencies { api 'commons-io:commons-io:2.15.1' api 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT' - api 'net.william278:ProfanityCheckerAPI:2.0.1' + api 'net.william278:profanitycheckerapi:3.0' api 'net.william278:desertwell:2.0.4' api 'dev.vankka:mcdiscordreserializer:4.3.0' api 'de.exlll:configlib-yaml:4.5.0' @@ -19,7 +19,7 @@ dependencies { compileOnly 'org.jetbrains:annotations:24.1.0' compileOnly 'org.projectlombok:lombok:1.18.30' - testImplementation 'net.william278:ProfanityCheckerAPI:2.0.1' + testImplementation 'net.william278:profanitycheckerapi:3.0' testImplementation 'net.kyori:adventure-api:4.15.0' annotationProcessor 'org.projectlombok:lombok:1.18.30' diff --git a/common/src/main/java/net/william278/huskchat/filter/ProfanityFilterer.java b/common/src/main/java/net/william278/huskchat/filter/ProfanityFilterer.java index fc629a2..03131b0 100644 --- a/common/src/main/java/net/william278/huskchat/filter/ProfanityFilterer.java +++ b/common/src/main/java/net/william278/huskchat/filter/ProfanityFilterer.java @@ -23,7 +23,6 @@ import lombok.Getter; import net.william278.huskchat.user.OnlineUser; import net.william278.profanitycheckerapi.ProfanityChecker; -import net.william278.profanitycheckerapi.ProfanityCheckerBuilder; import org.jetbrains.annotations.NotNull; /** @@ -34,7 +33,7 @@ public class ProfanityFilterer extends ChatFilter { @NotNull - private final ProfanityCheckerBuilder builder; + private final ProfanityChecker.ProfanityCheckerBuilder builder; public ProfanityFilterer(@NotNull FilterSettings settings) { super(settings); @@ -42,10 +41,11 @@ public ProfanityFilterer(@NotNull FilterSettings settings) { final ProfanityFilterSettings profanitySettings = (ProfanityFilterSettings) settings; this.builder = ProfanityChecker.builder(); if (profanitySettings.getLibraryPath() != null && !profanitySettings.getLibraryPath().isBlank()) { - builder.withLibraryPath(profanitySettings.getLibraryPath()); + builder.libraryPath(profanitySettings.getLibraryPath()); } if (profanitySettings.getMode() == ProfanityFilterMode.TOLERANCE) { - builder.withThresholdChecking(profanitySettings.getTolerance()); + builder.useThreshold(true); + builder.threshold(profanitySettings.getTolerance()); } initialize(); }