Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. /*
  2. * Das Plugin wurde von CodeSmart Programmiert
  3. * Alle Rechte gehören CodeSmart
  4. */
  5.  
  6. package at.codesmart.spigotsystem.main.config;
  7.  
  8. import org.bukkit.configuration.file.FileConfiguration;
  9. import org.bukkit.configuration.file.YamlConfiguration;
  10.  
  11. import java.io.File;
  12. import java.io.IOException;
  13.  
  14. public class ConfigManager {
  15.  
  16. private static File file = new File("plugins/Smart - SpigotSystem/config.yml");
  17. public static FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);
  18.  
  19. public static void createConfig() {
  20. if(!file.exists()) {
  21. file.mkdir();
  22. }
  23.  
  24. cfg.set("MSG.Prefix", "&b&lSpigotSystem &8[>>]&7 ");
  25. cfg.set("MSG.NoPerm", "Du hast dazu &keine &7Rechte");
  26. cfg.set("MSG.NoPlayer", "Du musst ein Spieler sein");
  27. cfg.set("MSG.OnUse", "&cVerwende: &7/");
  28.  
  29. try {
  30. cfg.save(file);
  31. } catch (IOException e) {
  32. e.printStackTrace();
  33. }
  34.  
  35. }
  36.  
  37. public static void saveConfig() {
  38. try {
  39. cfg.save(file);
  40. } catch (IOException e) {
  41. e.printStackTrace();
  42. }
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement