From a75643c1e4a40eb960c30385eb45bd480a5f7797 Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 17 Feb 2026 18:14:38 +0000 Subject: [PATCH] Remove Hytale chat formatter and update deps --- common/build.gradle | 2 +- .../luckperms/common/config/ConfigKeys.java | 9 +- .../cacheddata/MetaAccumulatorTest.java | 4 +- .../cacheddata/MetaStackAccumulatorTest.java | 2 +- .../cacheddata/MetaStackElementTest.java | 2 +- .../command/access/CommandPermissionTest.java | 2 +- .../treeview/PermissionRegistryTest.java | 2 +- hytale/build.gradle | 2 +- hytale/loader-with-deps/build.gradle | 2 +- .../src/main/resources/manifest.json | 2 +- hytale/loader/build.gradle | 2 +- .../loader/src/main/resources/manifest.json | 2 +- .../luckperms/hytale/LPHytalePlugin.java | 8 +- .../hytale/chat/LuckPermsChatFormatter.java | 102 ------------------ hytale/src/main/resources/config.yml | 35 ------ standalone/build.gradle | 2 +- 16 files changed, 19 insertions(+), 161 deletions(-) delete mode 100644 hytale/src/main/java/me/lucko/luckperms/hytale/chat/LuckPermsChatFormatter.java diff --git a/common/build.gradle b/common/build.gradle index fd70ea2a6..97541c2aa 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.13.0' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.testcontainers:junit-jupiter:1.21.1' + testImplementation 'org.testcontainers:testcontainers-junit-jupiter:2.0.2' testImplementation 'org.mockito:mockito-core:5.18.0' testImplementation 'org.mockito:mockito-junit-jupiter:5.18.0' diff --git a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java index 74f59755d..aaf889528 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/ConfigKeys.java @@ -756,14 +756,9 @@ public final class ConfigKeys { public static final ConfigKey RABBITMQ_PASSWORD = notReloadable(stringKey("rabbitmq.password", "guest")); /** - * If the chat formatter is enabled + * If the chat formatter is enabled - deprecated */ - public static final ConfigKey CHAT_FORMATTER_ENABLED = booleanKey("chat-formatter.enabled", true); - - /** - * The chat formatter format string - */ - public static final ConfigKey CHAT_FORMATTER_MESSAGE_FORMAT = stringKey("chat-formatter.message-format", ": "); + public static final ConfigKey CHAT_FORMATTER_ENABLED = booleanKey("chat-formatter.enabled", false); /** * If the editor key should be generated lazily (only when needed) diff --git a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaAccumulatorTest.java b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaAccumulatorTest.java index 6e91b7e9b..90b22c7e6 100644 --- a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaAccumulatorTest.java +++ b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaAccumulatorTest.java @@ -25,6 +25,8 @@ package me.lucko.luckperms.common.cacheddata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; import com.google.common.collect.ListMultimap; import me.lucko.luckperms.common.cacheddata.metastack.SimpleMetaStackDefinition; import me.lucko.luckperms.common.cacheddata.metastack.StandardStackElements; @@ -44,8 +46,6 @@ import net.luckperms.api.node.types.PrefixNode; import net.luckperms.api.node.types.SuffixNode; import net.luckperms.api.node.types.WeightNode; import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.collect.ImmutableList; -import org.testcontainers.shaded.com.google.common.collect.ImmutableSet; import java.util.SortedMap; diff --git a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackAccumulatorTest.java b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackAccumulatorTest.java index 4b681af90..f21b80122 100644 --- a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackAccumulatorTest.java +++ b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackAccumulatorTest.java @@ -25,6 +25,7 @@ package me.lucko.luckperms.common.cacheddata; +import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.cacheddata.metastack.SimpleMetaStackDefinition; import me.lucko.luckperms.common.cacheddata.metastack.StandardStackElements; import me.lucko.luckperms.common.cacheddata.result.StringResult; @@ -34,7 +35,6 @@ import net.luckperms.api.metastacking.DuplicateRemovalFunction; import net.luckperms.api.node.ChatMetaType; import net.luckperms.api.node.types.PrefixNode; import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.collect.ImmutableList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackElementTest.java b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackElementTest.java index 2a73395e5..bbd79bb69 100644 --- a/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackElementTest.java +++ b/common/src/test/java/me/lucko/luckperms/common/cacheddata/MetaStackElementTest.java @@ -25,6 +25,7 @@ package me.lucko.luckperms.common.cacheddata; +import com.google.common.collect.ImmutableList; import me.lucko.luckperms.common.cacheddata.metastack.StandardStackElements; import me.lucko.luckperms.common.model.HolderType; import me.lucko.luckperms.common.model.InheritanceOrigin; @@ -39,7 +40,6 @@ import net.luckperms.api.model.data.DataType; import net.luckperms.api.node.ChatMetaType; import net.luckperms.api.node.metadata.types.InheritanceOriginMetadata; import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.collect.ImmutableList; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/common/src/test/java/me/lucko/luckperms/common/command/access/CommandPermissionTest.java b/common/src/test/java/me/lucko/luckperms/common/command/access/CommandPermissionTest.java index b19f6f066..27a544db9 100644 --- a/common/src/test/java/me/lucko/luckperms/common/command/access/CommandPermissionTest.java +++ b/common/src/test/java/me/lucko/luckperms/common/command/access/CommandPermissionTest.java @@ -25,9 +25,9 @@ package me.lucko.luckperms.common.command.access; +import com.google.common.collect.ImmutableSet; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.testcontainers.shaded.com.google.common.collect.ImmutableSet; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/common/src/test/java/me/lucko/luckperms/common/treeview/PermissionRegistryTest.java b/common/src/test/java/me/lucko/luckperms/common/treeview/PermissionRegistryTest.java index bd228181c..d4c747f6f 100644 --- a/common/src/test/java/me/lucko/luckperms/common/treeview/PermissionRegistryTest.java +++ b/common/src/test/java/me/lucko/luckperms/common/treeview/PermissionRegistryTest.java @@ -25,9 +25,9 @@ package me.lucko.luckperms.common.treeview; +import com.google.common.collect.ImmutableSet; import com.google.gson.JsonObject; import org.junit.jupiter.api.Test; -import org.testcontainers.shaded.com.google.common.collect.ImmutableSet; import java.util.List; diff --git a/hytale/build.gradle b/hytale/build.gradle index 0dc09c270..dcfbd6101 100644 --- a/hytale/build.gradle +++ b/hytale/build.gradle @@ -12,7 +12,7 @@ dependencies { implementation 'com.google.guava:guava:19.0' implementation 'com.google.code.gson:gson:2.7' - compileOnly 'com.hypixel.hytale:Server:2026.01.24-6e2d4fc36' + compileOnly 'com.hypixel.hytale:Server:2026.02.17-255364b8e' } repositories { diff --git a/hytale/loader-with-deps/build.gradle b/hytale/loader-with-deps/build.gradle index 5d5939b34..ef852c629 100644 --- a/hytale/loader-with-deps/build.gradle +++ b/hytale/loader-with-deps/build.gradle @@ -10,7 +10,7 @@ dependencies { implementation project(':api') implementation project(':common:loader-utils') - compileOnly 'com.hypixel.hytale:Server:2026.01.24-6e2d4fc36' + compileOnly 'com.hypixel.hytale:Server:2026.02.17-255364b8e' } repositories { diff --git a/hytale/loader-with-deps/src/main/resources/manifest.json b/hytale/loader-with-deps/src/main/resources/manifest.json index 3bb242f8a..9c834534c 100644 --- a/hytale/loader-with-deps/src/main/resources/manifest.json +++ b/hytale/loader-with-deps/src/main/resources/manifest.json @@ -5,7 +5,7 @@ "Description": "A permissions plugin", "Authors": [{"Name": "Luck"}], "Website": "https://luckperms.net", - "ServerVersion": "*", + "ServerVersion": "2026.02.17-255364b8e", "Dependencies": {}, "OptionalDependencies": {}, "DisabledByDefault": false, diff --git a/hytale/loader/build.gradle b/hytale/loader/build.gradle index adcdae038..00de31623 100644 --- a/hytale/loader/build.gradle +++ b/hytale/loader/build.gradle @@ -6,7 +6,7 @@ dependencies { implementation project(':api') implementation project(':common:loader-utils') - compileOnly 'com.hypixel.hytale:Server:2026.01.24-6e2d4fc36' + compileOnly 'com.hypixel.hytale:Server:2026.02.17-255364b8e' } repositories { diff --git a/hytale/loader/src/main/resources/manifest.json b/hytale/loader/src/main/resources/manifest.json index 3bb242f8a..9c834534c 100644 --- a/hytale/loader/src/main/resources/manifest.json +++ b/hytale/loader/src/main/resources/manifest.json @@ -5,7 +5,7 @@ "Description": "A permissions plugin", "Authors": [{"Name": "Luck"}], "Website": "https://luckperms.net", - "ServerVersion": "*", + "ServerVersion": "2026.02.17-255364b8e", "Dependencies": {}, "OptionalDependencies": {}, "DisabledByDefault": false, diff --git a/hytale/src/main/java/me/lucko/luckperms/hytale/LPHytalePlugin.java b/hytale/src/main/java/me/lucko/luckperms/hytale/LPHytalePlugin.java index 2c2d4aaf6..8c8265a0b 100644 --- a/hytale/src/main/java/me/lucko/luckperms/hytale/LPHytalePlugin.java +++ b/hytale/src/main/java/me/lucko/luckperms/hytale/LPHytalePlugin.java @@ -50,7 +50,6 @@ import me.lucko.luckperms.common.plugin.util.AbstractConnectionListener; import me.lucko.luckperms.common.sender.Sender; import me.lucko.luckperms.hytale.calculator.HytaleCalculatorFactory; import me.lucko.luckperms.hytale.calculator.virtualgroups.VirtualGroupsMap; -import me.lucko.luckperms.hytale.chat.LuckPermsChatFormatter; import me.lucko.luckperms.hytale.context.HytaleContextManager; import me.lucko.luckperms.hytale.context.HytalePlayerCalculator; import me.lucko.luckperms.hytale.listeners.HytaleConnectionListener; @@ -203,10 +202,11 @@ public class LPHytalePlugin extends AbstractLuckPermsPlugin { } } - // chat if (getConfiguration().get(ConfigKeys.CHAT_FORMATTER_ENABLED)) { - LuckPermsChatFormatter chatFormatter = new LuckPermsChatFormatter(this); - chatFormatter.register(this.bootstrap.getLoader().getEventRegistry()); + getLogger().warn("The built-in LuckPerms chat formatter has been removed. Please delete the 'CHAT SETTINGS' section " + + "from your LuckPerms config.yml. We recommend that users migrate to " + + "mini-chat-formatter (https://github.com/lucko/mini-chat-formatter) or a suitable alternative." + + "Please see the LuckPerms wiki for more information: https://luckperms.net/wiki/Hytale#chat-formatting"); } // general diff --git a/hytale/src/main/java/me/lucko/luckperms/hytale/chat/LuckPermsChatFormatter.java b/hytale/src/main/java/me/lucko/luckperms/hytale/chat/LuckPermsChatFormatter.java deleted file mode 100644 index 9b743d6c1..000000000 --- a/hytale/src/main/java/me/lucko/luckperms/hytale/chat/LuckPermsChatFormatter.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of LuckPerms, licensed under the MIT License. - * - * Copyright (c) lucko (Luck) - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.lucko.luckperms.hytale.chat; - -import com.hypixel.hytale.event.EventRegistry; -import com.hypixel.hytale.server.core.Message; -import com.hypixel.hytale.server.core.event.events.player.PlayerChatEvent; -import com.hypixel.hytale.server.core.universe.PlayerRef; -import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.model.User; -import me.lucko.luckperms.hytale.HytaleSenderFactory; -import me.lucko.luckperms.hytale.LPHytalePlugin; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; -import net.kyori.adventure.text.minimessage.MiniMessage; -import net.kyori.adventure.text.minimessage.tag.TagPattern; -import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; -import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; -import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; -import org.jspecify.annotations.NonNull; - -public class LuckPermsChatFormatter implements PlayerChatEvent.Formatter { - private final LPHytalePlugin plugin; - private final String format; - - public LuckPermsChatFormatter(LPHytalePlugin plugin) { - this.plugin = plugin; - this.format = plugin.getConfiguration().get(ConfigKeys.CHAT_FORMATTER_MESSAGE_FORMAT); - } - - public void register(EventRegistry registry) { - registry.registerGlobal(PlayerChatEvent.class, this::onPlayerChat); - } - - private void onPlayerChat(PlayerChatEvent e) { - e.setFormatter(this); - } - - @Override - public @NonNull Message format(@NonNull PlayerRef playerRef, @NonNull String message) { - String username = playerRef.getUsername(); - String prefix = ""; - String suffix = ""; - - User user = this.plugin.getUserManager().getIfLoaded(playerRef.getUuid()); - if (user != null) { - prefix = user.getCachedData().getMetaData().getPrefix(); - if (prefix == null) { - prefix = ""; - } - suffix = user.getCachedData().getMetaData().getSuffix(); - if (suffix == null) { - suffix = ""; - } - } - - Component component = MiniMessage.miniMessage().deserialize( - this.format, - parse("prefix", prefix), - parse("suffix", suffix), - Placeholder.unparsed("username", username), - Placeholder.unparsed("message", message) - ); - return HytaleSenderFactory.toHytaleMessage(component); - } - - private static TagResolver parse(@TagPattern String key, String value) { - boolean containsLegacyFormattingCharacter = value.indexOf(LegacyComponentSerializer.AMPERSAND_CHAR) != -1 - || value.indexOf(LegacyComponentSerializer.SECTION_CHAR) != -1; - - if (containsLegacyFormattingCharacter) { - TextComponent component = LegacyComponentSerializer.legacyAmpersand().deserialize(value); - return Placeholder.component(key, component); - } else { - return Placeholder.parsed(key, value); - } - } - -} diff --git a/hytale/src/main/resources/config.yml b/hytale/src/main/resources/config.yml index 2a21d7c22..a0241e6b2 100644 --- a/hytale/src/main/resources/config.yml +++ b/hytale/src/main/resources/config.yml @@ -46,41 +46,6 @@ use-server-uuid-cache: false -# +----------------------------------------------------------------------------------------------+ # -# | | # -# | CHAT SETTINGS | # -# | | # -# | Controls how LuckPerms should format messages from players in the chat. | # -# | | # -# +----------------------------------------------------------------------------------------------+ # - -# Configuration for the built-in LuckPerms chat formatter. -# -# Note: This functionality is only intended for simple chat formatting needs. For more advanced -# chat formatting, we recommend using a dedicated chat plugin that integrates with LuckPerms. -# -# When enabled, LuckPerms formats the chat using the format defined below. -# The following placeholders are supported: -# -# - : The players prefix meta value -# - : The players username -# - : The players suffix meta value -# - : The actual chat message sent by the player -# -# The format string, as well as the prefix and suffix values support formatting using MiniMessage: -# https://docs.papermc.io/adventure/minimessage/ -# -chat-formatter: - - # If LuckPerms should handle chat formatting. - enabled: true - - # The format to use. - message-format: ": " - - - - # +----------------------------------------------------------------------------------------------+ # # | | # # | STORAGE SETTINGS | # diff --git a/standalone/build.gradle b/standalone/build.gradle index db128784b..ed71fe2a9 100644 --- a/standalone/build.gradle +++ b/standalone/build.gradle @@ -28,7 +28,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.13.0' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.testcontainers:junit-jupiter:1.21.1' + testImplementation 'org.testcontainers:testcontainers-junit-jupiter:2.0.2' testImplementation 'org.mockito:mockito-core:5.18.0' testImplementation 'org.mockito:mockito-junit-jupiter:5.18.0' testImplementation 'org.awaitility:awaitility:4.3.0'