diff --git a/velocity/pom.xml b/velocity/pom.xml
index 66d82f59..d91f493f 100644
--- a/velocity/pom.xml
+++ b/velocity/pom.xml
@@ -32,7 +32,7 @@
com.velocitypowered
velocity-api
- 3.1.0
+ 3.4.0-SNAPSHOT
provided
diff --git a/velocity/src/main/java/co/aikar/commands/VelocityLocales.java b/velocity/src/main/java/co/aikar/commands/VelocityLocales.java
index 71737129..527d03a5 100644
--- a/velocity/src/main/java/co/aikar/commands/VelocityLocales.java
+++ b/velocity/src/main/java/co/aikar/commands/VelocityLocales.java
@@ -1,6 +1,19 @@
package co.aikar.commands;
+import co.aikar.locales.MessageKey;
+import org.spongepowered.configurate.ConfigurateException;
+import org.spongepowered.configurate.ConfigurationNode;
+import org.spongepowered.configurate.ConfigurationVisitor;
+import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
public class VelocityLocales extends Locales {
private final VelocityCommandManager manager;
@@ -18,4 +31,100 @@ public void loadLanguages() {
String pluginName = "acf-" + manager.plugin.getDescription().getName().get();
addMessageBundles("acf-minecraft", pluginName, pluginName.toLowerCase(Locale.ENGLISH));
}
+
+ /**
+ * Loads the given file
+ *
+ * @param file
+ * @param locale
+ * @return If any language keys were added
+ * @throws IOException
+ * @throws ConfigurateException
+ */
+ public boolean loadYamlLanguageFile(File file, Locale locale) throws IOException {
+ ConfigurationNode configuration = YamlConfigurationLoader.builder().file(file).build().load();
+ return loadLanguage(configuration, locale);
+ }
+
+ /**
+ * Loads a file out of the plugin's data folder by the given name
+ *
+ * @param file
+ * @param locale
+ * @return If any language keys were added
+ * @throws IOException
+ * @throws ConfigurateException
+ */
+ public boolean loadYamlLanguageFile(String file, Locale locale) throws IOException {
+ File pluginDir = new File("plugins", this.manager.getPlugin().getDescription().getId());
+ return loadYamlLanguageFile(new File(pluginDir, file), locale);
+ }
+
+ /**
+ * Loads every message from the Configuration object. Any nested values will be treated as namespace
+ * so acf-core:\n\tfoo: bar will be acf-core.foo = bar
+ *
+ * @param config
+ * @param locale
+ * @return If any language keys were added
+ */
+ public boolean loadLanguage(ConfigurationNode config, Locale locale) {
+ AtomicBoolean loaded = new AtomicBoolean(false);
+ Map visit = config.visit(new ConfigurationVisitor.Safe