mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
do not parse markdown for messages
This commit is contained in:
@@ -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>
|
||||
|
||||
+12
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user