Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kwkit.metodos;
- import java.io.File;
- import java.io.IOException;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.plugin.Plugin;
- public class KwConfig {
- private static Plugin pl = KwMetodos.getPlugin();
- private static FileConfiguration m, v;
- private static File membros, f, vip;
- private static void getPasta() {
- f = new File(pl.getDataFolder(), "Kits");
- if (!f.exists()) {
- f.mkdirs();
- }
- }
- private static void getMembros() {
- membros = new File(pl.getDataFolder() + "/Kits/membro.yml");
- if (!membros.exists()) {
- try {
- membros.createNewFile();
- pl.getServer().getScheduler().scheduleSyncDelayedTask(pl, new Runnable() {
- @Override
- public void run() {
- pl.saveResource("Kits/membro.yml", true);
- m = YamlConfiguration.loadConfiguration(membros);
- }
- }, 1 * 20L);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- private static void getVIP() {
- vip = new File(pl.getDataFolder() + "/Kits/vip.yml");
- if (!vip.exists()) {
- try {
- vip.createNewFile();
- pl.getServer().getScheduler().scheduleSyncDelayedTask(pl, new Runnable() {
- @Override
- public void run() {
- pl.saveResource("Kits/vip.yml", true);
- v = YamlConfiguration.loadConfiguration(vip);
- }
- }, 4 * 20L);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- private static void getArquivos() {
- getMembros();
- getVIP();
- }
- public static void getKits() {
- getPasta();
- getArquivos();
- }
- public static FileConfiguration getCnf() {
- return m;
- }
- public static FileConfiguration getV() {
- return v;
- }
- public static String getCnf(String cnf) {
- return KwConfig.m.getString(cnf);
- }
- public static String getReplaced(String cnf) {
- return KwMetodos.replaced(getCnf(cnf));
- }
- public static String getCnfV(String cnf) {
- return KwConfig.v.getString(cnf);
- }
- public static String getReplacedV(String cnf) {
- return KwMetodos.replaced(getCnf(cnf));
- }
- }
Add Comment
Please, Sign In to add comment