diff --git a/src/main/java/de/rayzs/pat/plugin/VelocityLoader.java b/src/main/java/de/rayzs/pat/plugin/VelocityLoader.java index 5aef1965..19fc9ea4 100644 --- a/src/main/java/de/rayzs/pat/plugin/VelocityLoader.java +++ b/src/main/java/de/rayzs/pat/plugin/VelocityLoader.java @@ -21,6 +21,7 @@ import de.rayzs.pat.utils.ConnectionBuilder; import de.rayzs.pat.utils.MessageTranslator; import de.rayzs.pat.utils.Reflection; import de.rayzs.pat.utils.Storage; +import de.rayzs.pat.utils.configuration.Configurator; import de.rayzs.pat.utils.group.GroupManager; import net.kyori.adventure.text.minimessage.MiniMessage; @@ -50,6 +51,10 @@ public class VelocityLoader { @Subscribe public void onProxyInitialization(ProxyInitializeEvent event) { Reflection.initialize(server); + + Configurator.createResourcedFile("./plugins/ProAntiTab", "files\\velocity-config.yml", "config.yml", false); + Configurator.createResourcedFile("./plugins/ProAntiTab", "files\\velocity-storage.yml", "storage.yml", false); + Storage.load(); GroupManager.initialize(); diff --git a/src/main/java/de/rayzs/pat/utils/Storage.java b/src/main/java/de/rayzs/pat/utils/Storage.java index d2a32006..2c7ab960 100644 --- a/src/main/java/de/rayzs/pat/utils/Storage.java +++ b/src/main/java/de/rayzs/pat/utils/Storage.java @@ -55,7 +55,7 @@ public class Storage { UNKNOWN_COMMAND = (ArrayList) CONFIGURATION.getOrSet("custom-unknown-command.message", defaultUnknownCommandArray); } - TOKEN = (String) CONFIGURATION.getOrSet(Reflection.isProxyServer() ? "token" : "handle-through-bungeecord.token", Reflection.isProxyServer() ? TOKEN : "insert-token-of-bungeecord-here"); + TOKEN = (String) CONFIGURATION.getOrSet(Reflection.isProxyServer() && !Reflection.isVelocityServer() ? "token" : "handle-through-bungeecord.token", Reflection.isProxyServer() ? TOKEN : "insert-token-of-bungeecord-here"); NOTIFY_ENABLED = (String) CONFIGURATION.getOrSet("notification.enabled", "&aEnabled notifications!"); NOTIFY_DISABLED = (String) CONFIGURATION.getOrSet("notification.disabled", "&cDisabled notifications!"); diff --git a/src/main/java/de/rayzs/pat/utils/configuration/Configurator.java b/src/main/java/de/rayzs/pat/utils/configuration/Configurator.java index 83685d97..2e56a202 100644 --- a/src/main/java/de/rayzs/pat/utils/configuration/Configurator.java +++ b/src/main/java/de/rayzs/pat/utils/configuration/Configurator.java @@ -73,4 +73,8 @@ public class Configurator { throwable.printStackTrace(); } } + + public static void createResourcedFile(String dataFolder, String resourcePath, String exportRessourcePath, boolean replace) { + createResourcedFile(new File(dataFolder), resourcePath, exportRessourcePath, replace); + } } diff --git a/src/main/resources/files/velocity-config.yml b/src/main/resources/files/velocity-config.yml index bbf675b7..7c3c1d8a 100644 --- a/src/main/resources/files/velocity-config.yml +++ b/src/main/resources/files/velocity-config.yml @@ -1,5 +1,3 @@ -token: - updater: enabled: true period: 18000