do not parse markdown for messages

This commit is contained in:
2021-10-24 19:51:22 +02:00
parent 7c3a06e704
commit 48fbd59a50
16 changed files with 57 additions and 46 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>Common</artifactId>
@@ -5,6 +5,7 @@ import eu.endermite.commandwhitelist.common.ConfigCache;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.transformation.TransformationType;
import java.util.ArrayList;
import java.util.Collection;
@@ -12,6 +13,16 @@ import java.util.List;
public class CWCommand {
public static MiniMessage miniMessage = MiniMessage.builder()
.removeDefaultTransformations()
.transformation(TransformationType.COLOR)
.transformation(TransformationType.DECORATION)
.transformation(TransformationType.GRADIENT)
.transformation(TransformationType.RESET)
.transformation(TransformationType.RAINBOW)
.transformation(TransformationType.PRE)
.build();
public static boolean addToWhitelist(ConfigCache configCache, String command, String group) {
CWGroup cwGroup = configCache.getGroupList().get(group);
if (cwGroup == null) return false;
@@ -30,7 +41,7 @@ public class CWCommand {
}
public static Component helpComponent(String baseCommand, boolean showReloadCommand, boolean showAdminCommands) {
Component component = MiniMessage.markdown().parse("<rainbow><bold>CommandWhitelist by YouHaveTrouble")
Component component = miniMessage.parse("<rainbow><bold>CommandWhitelist by YouHaveTrouble")
.append(Component.newline());
component = component.append(Component.text("/" + baseCommand + " help").color(NamedTextColor.AQUA).append(Component.text(" - Displays this message").color(NamedTextColor.BLUE)));
if (showReloadCommand) {