From 383c8f8727cee274ad5e96eb807129407763b5eb Mon Sep 17 00:00:00 2001 From: ColdDev Date: Mon, 24 Oct 2022 21:21:16 +0100 Subject: [PATCH] fix(config): restructure config file to fix weird bug with comments --- pom.xml | 2 +- src/main/java/uranium/Main.java | 4 ++- src/main/resources/config.yml | 58 ++++++++++++++++++++++++--------- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 63b8f20..a8772ab 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ ${project.basedir}/out/${project.artifactId}.jar - true + false diff --git a/src/main/java/uranium/Main.java b/src/main/java/uranium/Main.java index 5a6669f..bfd2945 100644 --- a/src/main/java/uranium/Main.java +++ b/src/main/java/uranium/Main.java @@ -11,6 +11,8 @@ import uranium.listeners.*; import uranium.tasks.IPCheck; import uranium.user.*; +import java.io.File; + public class Main extends JavaPlugin implements PluginMessageListener { public void onEnable() { @@ -59,7 +61,7 @@ public class Main extends JavaPlugin implements PluginMessageListener { private void setupConfig() { getLogger().info("Initializing config..."); getConfig().options().copyDefaults(true); - saveConfig(); + saveDefaultConfig(); } @SuppressWarnings("UnstableApiUsage") diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a45e3d9..4da2ff4 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,27 +1,58 @@ +############ Explanation of Config Options ############### +# chat-filter: +# enabled: true +# # Should usernames be checked on join? +# check-usernames: true +# # Should we also check the contents of commands? +# check-commands: true +# # Should posting the same message twice in a row be allowed? +# double-posting: false +# # Should there be an enforced delay between messages? +# message-delay: true +# # What should the delay be for messages? +# message-cooldown: 1000 +# # The list of words that should be prevented from being used +# banned-words: +# - poop +# suspicious-domains: +# # Should we check for suspicious domains? +# enabled: true +# # Should we notify if the user is using an offline download? +# offline-download: true +# # Should we notify if the user is using the debug runtime? +# debug-runtime: true +# # A list of trusted domains. These will not generate an alert +# trusted-domains: +# - 'precisionclient.vercel.app' +# - 'eaglercraft.org' +# - 'eaglercraft.us' +# - 'eaglercraft.me' +# - 'eaglercraft.net' +# - 'g.deev.is' +# - 'g.lax1dude.net' +# # Should we send a notification to a Discord webhook when +# # a suspicious domain is detected? +# enable-webhook: false +# # Provide your Discord webhook URL here. +# webhook-url: '' +# +# Should we override the regular /banip, /ipban & /ban-ip commands with Uranium's version? +# override-ipban: true +# Main prefix +# prefix: '&8[&aUranium&8] &7' chat-filter: - # Should we enable the chat filter? enabled: true - # Should usernames be checked on join? check-usernames: true - # Should we also check the contents of commands? check-commands: true - # Should posting the same message twice in a row be allowed? double-posting: false - # Should there be an enforced delay between messages? message-delay: true - # What should the delay be for messages? message-cooldown: 1000 - # The list of words that should be prevented from being used banned-words: - poop suspicious-domains: - # Should we check for suspicious domains? enabled: true - # Should we notify if the user is using an offline download? offline-download: true - # Should we notify if the user is using the debug runtime? debug-runtime: true - # A list of trusted domains. These will not generate an alert trusted-domains: - 'precisionclient.vercel.app' - 'eaglercraft.org' @@ -30,13 +61,8 @@ suspicious-domains: - 'eaglercraft.net' - 'g.deev.is' - 'g.lax1dude.net' - # Should we send a notification to a Discord webhook when - # a suspicious domain is detected? enable-webhook: false - # Provide your Discord webhook URL here. webhook-url: '' -# Should we override the regular /banip, /ipban & /ban-ip commands with Uranium's version? override-ipban: true -# Main prefix prefix: '&8[&aUranium&8] &7' \ No newline at end of file