Addons

You will be able to create custom addons and unlimited config files!

Main class

package com.edwardbelt.edprisonapi;

import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

import com.edwardbelt.edprison.EdPrison;
import com.edwardbelt.edprison.Addons.Addon;

public class Main extends JavaPlugin {

	private static Plugin instance;
	public Addon addon;
	
	@Override
	public void onEnable() {
		
		instance = this;
		/*
		 * GETTING EDPRISON INSTANCE + YOUR PLUGIN INSTANCE
		*/
		EdPrison api = (EdPrison) Bukkit.getPluginManager().getPlugin("EdPrison");
		Plugin wc = Bukkit.getPluginManager().getPlugin("YourPluginName");
		
		/*
		 *  REGISTER THE ADDON + REGISTER A CONFIG FILE
		 */
		addon = new Addon("YourAddonName", api, wc); // DEFINES THE ADDON
		addon.register(); // REGISTERS THE ADDON //
		addon.registerFile("config.yml"); // REGISTER A YAML FILE //
		
		/* GETS THE CONFIGURATION FILE, CHANGES THE VALUES AND SAVE IT */
		FileConfiguration config = addon.getFile("config.yml")
		config.set("Hello-World", true);
		addon.saveFile("config.yml");
	}
	
	
	
	public void onDisable() {
		System.out.println("Disabling");
	}
	

}
	

Last updated