64 lines
2.2 KiB
Java
64 lines
2.2 KiB
Java
package net.t2code.autoresponse.Spigot.config.languages;
|
|
|
|
import net.t2code.autoresponse.Util;
|
|
import net.t2code.autoresponse.Spigot.Main;
|
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
|
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
public class CreateMessages {
|
|
private static Plugin plugin = Main.getPlugin();
|
|
|
|
public static void langCreate() {
|
|
T2Csend.debug(plugin,"§4Language files are created / updated...");
|
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
|
|
/**
|
|
*
|
|
* ENGLISH
|
|
*
|
|
*/
|
|
|
|
File messagesEN = new File(Main.getPath(), "languages/english_messages.yml");
|
|
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
|
|
|
|
T2Cconfig.set("Plugin.Reload.Start", MSG.EN_ReloadStart, yamlConfigurationEN);
|
|
T2Cconfig.set("Plugin.Reload.End", MSG.EN_ReloadEnd, yamlConfigurationEN);
|
|
T2Cconfig.set("Plugin.ForCommand", MSG.EN_NoPermissionForCommand, yamlConfigurationEN);
|
|
|
|
try {
|
|
yamlConfigurationEN.save(messagesEN);
|
|
} catch (IOException e) {
|
|
T2Csend.warning(plugin,e.getMessage());
|
|
e.printStackTrace();
|
|
}
|
|
|
|
/**
|
|
*
|
|
* GERMAN
|
|
*
|
|
*/
|
|
|
|
|
|
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
|
|
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
|
|
|
|
T2Cconfig.set("Plugin.Reload.Start", MSG.DE_ReloadStart, yamlConfigurationDE);
|
|
T2Cconfig.set("Plugin.Reload.End", MSG.DE_ReloadEnd, yamlConfigurationDE);
|
|
T2Cconfig.set("Plugin.ForCommand", MSG.DE_NoPermissionForCommand, yamlConfigurationDE);
|
|
|
|
try {
|
|
yamlConfigurationDE.save(messagesDE);
|
|
} catch (IOException e) {
|
|
T2Csend.warning(plugin,e.getMessage());
|
|
e.printStackTrace();
|
|
}
|
|
|
|
T2Csend.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
}
|
|
}
|