package org.monospark.actionpermissions;

import org.spongepowered.api.plugin.Plugin;

@Plugin(id = "actionpermissions", name = "ActionPermissions", version = "1.0")
public class ActionPermissions {

}

@@ -35,16 +35,468 @@
 sions;%0A%0A
+import java.nio.file.Path;%0A%0Aimport org.monospark.actionpermissions.config.ConfigParseException;%0Aimport org.monospark.actionpermissions.group.Group;%0Aimport org.monospark.actionpermissions.handler.ActionHandler;%0Aimport org.spongepowered.api.Sponge;%0Aimport org.spongepowered.api.config.ConfigDir;%0Aimport org.spongepowered.api.event.Event;%0Aimport org.spongepowered.api.event.Listener;%0Aimport org.spongepowered.api.event.game.state.GameInitializationEvent;%0A
 import o
@@ -532,16 +532,50 @@
 lugin;%0A%0A
+import com.google.inject.Inject;%0A%0A
 @Plugin(
@@ -678,11 +678,570 @@
 sions %7B%0A
+%09%0A%09@Inject%0A%09@ConfigDir(sharedRoot = false)%0A%09private Path privateConfigDir;%0A%09%0A%09@Listener%0A%09public void onServerInit(GameInitializationEvent event) %7B%0A%09%09for(ActionHandler%3C?, ?%3E handler : ActionHandler.ALL) %7B%0A%09%09%09registerActionHandler(handler);%0A%09%09%7D%0A%09%09%0A%09%09try %7B%0A%09%09%09Group.getRegistry().loadGroups(privateConfigDir);%0A%09%09%7D catch (ConfigParseException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%09%0A%09private %3CE extends Event%3E void registerActionHandler(ActionHandler%3CE, ?%3E handler) %7B%0A%09%09Sponge.getGame().getEventManager().registerListener(this, handler.getEventClass(), handler);%0A%09%7D
 %0A%7D%0A

Load the group config on startup