Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. package com.mclaurence.mcraces;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.bukkit.configuration.file.FileConfiguration;
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class MainClass extends JavaPlugin {
  11.  
  12. private File file;
  13. private FileConfiguration config;
  14.  
  15. @Override
  16. public void onEnable(){
  17. getServer().getPluginManager().registerEvents(new MainListener(this), this);
  18. this.getCommand("races").setExecutor(new RacesCommand(this));
  19. this.load();
  20. this.save();
  21. }
  22.  
  23. private void load(){
  24. this.file = new File(this.getDataFolder(), "Races.yml");
  25. this.config = YamlConfiguration.loadConfiguration(this.file);
  26. }
  27.  
  28. public void save(){
  29. try {
  30. this.config.save(this.file);
  31. } catch (IOException e) {
  32. e.printStackTrace();
  33. }
  34. }
  35.  
  36. public FileConfiguration config(){
  37. return config;
  38. }
  39.  
  40. public void print(){
  41. System.out.println("AIGHAI");
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement