52 lines
2.8 KiB
Java
52 lines
2.8 KiB
Java
|
package net.t2code.autoresponse.Spigot.config.response;
|
||
|
|
||
|
import net.t2code.autoresponse.Util;
|
||
|
import net.t2code.autoresponse.Spigot.Main;
|
||
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||
|
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||
|
|
||
|
import java.io.File;
|
||
|
import java.io.IOException;
|
||
|
import java.util.Arrays;
|
||
|
|
||
|
public class CreateExampleResponse {
|
||
|
|
||
|
public static void configCreate() {
|
||
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||
|
if (new File(Main.getPath(), "config.yml").exists()) {
|
||
|
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||
|
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
||
|
|
||
|
|
||
|
File config = new File(Main.getPath(), "Responses/responseexample.yml");
|
||
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||
|
|
||
|
|
||
|
Config.set("Response.Enable", true, yamlConfiguration);
|
||
|
Config.set("Response.ResponseKey", ".example", yamlConfiguration);
|
||
|
Config.set("Response.Contains", false, yamlConfiguration);
|
||
|
Config.set("Response.Permission.Necessary", true, yamlConfiguration);
|
||
|
Config.set("Response.Permission.Permission", "t2c-autoresponse.response.example", yamlConfiguration);
|
||
|
|
||
|
Config.set("Response.Command.Enable", false, yamlConfiguration);
|
||
|
Config.set("Response.Command.CommandAsConsole", false, yamlConfiguration);
|
||
|
Config.set("Response.Command.BungeeCommand", false, yamlConfiguration);
|
||
|
Config.set("Response.Command.Commands", Arrays.asList("say hi"), yamlConfiguration);
|
||
|
|
||
|
Config.set("Response.Message.Enable", true, yamlConfiguration);
|
||
|
Config.set("Response.Message.Messages", Arrays.asList("&2This is an Automated response from §8[§4T2Code§7-§bAutoResponse§8]&2.", "&6Contact us for questions / support on our Discord."), yamlConfiguration);
|
||
|
Config.set("Response.Message.TextBuilder.Enable", true, yamlConfiguration);
|
||
|
Config.set("Response.Message.TextBuilder.Hover", "&5Discord: &edc.t2code.net", yamlConfiguration);
|
||
|
Config.set("Response.Message.TextBuilder.ClickEvent.Enable", true, yamlConfiguration);
|
||
|
Config.set("Response.Message.TextBuilder.ClickEvent.Action", "OPEN_URL", yamlConfiguration);
|
||
|
Config.set("Response.Message.TextBuilder.ClickEvent.ActionValue", "dc.t2code.net", yamlConfiguration);
|
||
|
try {
|
||
|
yamlConfiguration.save(config);
|
||
|
} catch (IOException e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||
|
}
|
||
|
}
|