Finished party command, and sub commands

This commit is contained in:
2021-08-08 11:36:06 +02:00
parent 0932bf8d51
commit 2cb843b68c
18 changed files with 462 additions and 142 deletions
@@ -1,6 +1,6 @@
package com.alttd.chat.config;
import com.alttd.chat.objects.Channel;
import com.alttd.chat.objects.channels.CustomChannel;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.reflect.TypeToken;
@@ -68,7 +68,6 @@ public final class Config {
e.printStackTrace();
}
}
public static void readConfig(Class<?> clazz, Object instance) {
for (Method method : clazz.getDeclaredMethods()) {
if (Modifier.isPrivate(method.getModifiers())) {
@@ -156,6 +155,7 @@ public final class Config {
return config.getNode(splitPath(path));
}
/** ONLY EDIT ANYTHING BELOW THIS LINE **/
public static List<String> PREFIXGROUPS = new ArrayList<>();
public static List<String> STAFFGROUPS = new ArrayList<>();
@@ -202,6 +202,11 @@ public final class Config {
GCCOOLDOWN = getInt("commands.globalchat.cooldown", GCCOOLDOWN);
}
public static String PARTY_FORMAT = "<dark_aqua>(<gray><sender></gray> <hover:show_text:on <server>> → Party</hover>) <message>";
private static void party() {
PARTY_FORMAT = getString("party.format", PARTY_FORMAT);
}
// TODO prefixes need hovers, this hasn't been setup yet!
public static String CHATFORMAT = "<white><light_purple><prefixall> <gray><hover:show_text:Click to message <sendername>><click:suggest_command:/msg <sendername> ><sender></hover>: <white><message>";
private static void Chat() {
@@ -249,7 +254,7 @@ public final class Config {
for (ConfigurationNode configurationNode : node.getChildrenMap().values()) {
String channelName = Objects.requireNonNull(configurationNode.getKey()).toString();
String key = "chat-channels." + channelName + ".";
new Channel(channelName,
new CustomChannel(channelName,
getString(key + "format", ""),
getList(key + "servers", Collections.EMPTY_LIST),
getBoolean(key + "proxy", false));