feat: config

This commit is contained in:
TheClashFruit 2023-06-27 17:56:35 +02:00
parent 2cb56bf357
commit 829235ce1b
Signed by: TheClashFruit
GPG key ID: CF4A319B9A73290C
12 changed files with 23 additions and 17 deletions

Binary file not shown.

View file

@ -35,7 +35,7 @@ dependencies {
modImplementation "io.wispforest:owo-lib:${project.owo_version}" modImplementation "io.wispforest:owo-lib:${project.owo_version}"
// placeholders // placeholders
modImplementation include("eu.pb4:placeholder-api:2.1.0+1.19.4") modImplementation include("eu.pb4:placeholder-api:${project.papi_version}")
// config yay // config yay
annotationProcessor "io.wispforest:owo-lib:${project.owo_version}" annotationProcessor "io.wispforest:owo-lib:${project.owo_version}"

View file

@ -17,3 +17,4 @@ archives_base_name = yadmb
fabric_version=0.84.0+1.19.4 fabric_version=0.84.0+1.19.4
owo_version=0.10.4+1.19.4 owo_version=0.10.4+1.19.4
jda_version=5.0.0-beta.11 jda_version=5.0.0-beta.11
papi_version=2.1.0+1.19.4

View file

@ -13,5 +13,9 @@ public class YADMB implements ModInitializer {
@Override @Override
public void onInitialize() { public void onInitialize() {
LOGGER.info("Oh wow, it started, anyways I'm just here to litter your logs."); LOGGER.info("Oh wow, it started, anyways I'm just here to litter your logs.");
if(CONFIG.schemaVersion() != 1) {
LOGGER.error("Unknown schema version! Please fix the config file at config/yadmb.json5. Server could crash while starting this mod!");
}
} }
} }

View file

@ -13,18 +13,13 @@ public class MainConfigModel {
public String token = ""; public String token = "";
public long channel = 0; public long channel = 0;
public long guild = 0; public long guild = 0;
}
@Nest
public Messages messages = new Messages();
public static class Messages {
@Nest @Nest
public MessagesDiscord discord = new MessagesDiscord(); public Messages messages = new Messages();
public static class MessagesDiscord { public static class Messages {
@Nest @Nest
public ChatMessage chatMessage = new ChatMessage(); public ChatMessage chat = new ChatMessage();
public static class ChatMessage { public static class ChatMessage {
public String content = "${message}"; public String content = "${message}";
@ -34,17 +29,14 @@ public class MainConfigModel {
public static class Webhook { public static class Webhook {
public Boolean enabled = true; public Boolean enabled = true;
public String username = "${username}"; public String username = "${player:username}";
public String avatarUrl = "https://crafatar.com/avatars/${uuid}"; public String avatar = "https://crafatar.com/avatars/${player:uuid}";
} }
} }
} }
}
@Nest public static class Minecraft {
public MessagesMinecraft minecraft = new MessagesMinecraft(); public String format = "<<color:${discord:role_colour}>${discord:display_name}<reset>> ${discord:message}";
public static class MessagesMinecraft {
}
} }
} }

View file

@ -0,0 +1,9 @@
package me.theclashfruit.yadmb.util;
public class DiscordMessageParser {
public static String parse(String message) {
// nah
return message;
}
}