package au.com.mineauz.minigamesregions;

import org.bukkit.plugin.java.JavaPlugin;

import au.com.mineauz.minigames.Minigames;
import au.com.mineauz.minigames.commands.set.SetCommand;
import au.com.mineauz.minigamesregions.commands.SetNodeCommand;
import au.com.mineauz.minigamesregions.commands.SetRegionCommand;

public class Main extends JavaPlugin{
	
	private static Minigames minigames;
	private static Main plugin;
	
	@Override
	public void onEnable(){
		plugin = this;
		if(getServer().getPluginManager().getPlugin("Minigames") != null){
			minigames = Minigames.plugin;
		}
		else{
			getLogger().severe("Minigames plugin not found! You must have the plugin to use Regions!");
			this.getPluginLoader().disablePlugin(this);
		}
		
		minigames.mdata.addModule(RegionModule.class);
		
		SetCommand.registerSetCommand(new SetNodeCommand());
		SetCommand.registerSetCommand(new SetRegionCommand());
		
		getServer().getPluginManager().registerEvents(new RegionEvents(), this);
		
		getLogger().info("Minigames Regions successfully enabled!");
	}
	
	@Override
	public void onDisable(){
		minigames.mdata.removeModule("Regions", RegionModule.class);
		getLogger().info("Minigames Regions disabled");
	}
	
	public static Minigames getMinigames(){
		return minigames;
	}
	
	public static Main getPlugin(){
		return plugin;
	}
}

@@ -170,32 +170,83 @@
 set.SetCommand;%0A
+import au.com.mineauz.minigames.minigame.Minigame;%0A
 import au.com.mi
@@ -1134,16 +1134,107 @@
 able()%7B%0A
+%09%09for(Minigame mg : minigames.mdata.getAllMinigames().values())%7B%0A%09%09%09mg.saveMinigame();%0A%09%09%7D%0A
 %09%09miniga

Save all Minigames before disabling regions