Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mclaurence.mcraces;
- import java.io.File;
- import java.io.IOException;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.plugin.java.JavaPlugin;
- public class MainClass extends JavaPlugin {
- private File file;
- private FileConfiguration config;
- @Override
- public void onEnable(){
- getServer().getPluginManager().registerEvents(new MainListener(this), this);
- this.getCommand("races").setExecutor(new RacesCommand(this));
- this.load();
- this.save();
- }
- private void load(){
- this.file = new File(this.getDataFolder(), "Races.yml");
- this.config = YamlConfiguration.loadConfiguration(this.file);
- }
- public void save(){
- try {
- this.config.save(this.file);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public FileConfiguration config(){
- return config;
- }
- public void print(){
- System.out.println("AIGHAI");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement