mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-11 22:16:57 +00:00
more reorganizing and making things work
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>1.28</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+3
-1
@@ -8,6 +8,8 @@ import java.util.*;
|
||||
|
||||
public class ConfigCache {
|
||||
|
||||
//TODO probably rewrite this yet again
|
||||
|
||||
private final File configFile;
|
||||
private final boolean canDoProtocolLib;
|
||||
private final HashMap<String, CWGroup> groupList = new LinkedHashMap<>();
|
||||
@@ -55,7 +57,7 @@ public class ConfigCache {
|
||||
}
|
||||
|
||||
groups.putIfAbsent("default", new CWGroup("default", defaultCommands, defaultSubcommands).serialize());
|
||||
|
||||
//TODO find a way to update groups
|
||||
data.putIfAbsent("groups", groups);
|
||||
|
||||
DumperOptions dumperOptions = new DumperOptions();
|
||||
|
||||
+4
-2
@@ -1,11 +1,13 @@
|
||||
package eu.endermite.commandwhitelist.common.commands;
|
||||
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import eu.endermite.commandwhitelist.common.CWGroup;
|
||||
import eu.endermite.commandwhitelist.common.ConfigCache;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.event.HoverEvent;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
|
||||
|
||||
public class CWCommand {
|
||||
@@ -28,8 +30,8 @@ public class CWCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Component helpComponent(String baseCommand, boolean showReloadCommand, boolean showAdminCommands) {
|
||||
Component component = Component.text("CommandWhitelist by YouHaveTrouble").decorate(TextDecoration.BOLD).color(NamedTextColor.BLUE)
|
||||
public static Component helpComponent(String baseCommand, boolean showReloadCommand, boolean showAdminCommands) {
|
||||
Component component = MiniMessage.markdown().parse("<rainbow><bold>CommandWhitelist by YouHaveTrouble")
|
||||
.append(Component.newline());
|
||||
component = component.append(Component.text("Hover over the command to see what it does!").color(NamedTextColor.AQUA)).decoration(TextDecoration.BOLD, false).append(Component.newline());
|
||||
component = component.append(Component.text("/"+baseCommand+" help").color(NamedTextColor.AQUA).hoverEvent(HoverEvent.showText(Component.text("Displays this message"))));
|
||||
|
||||
Reference in New Issue
Block a user