Permalink
Browse files

Working on updated permissions support

  • Loading branch information...
1 parent 142ab9e commit 24d83840afd5bf36268d6928a59e98700a8336d0 @brad811 committed May 3, 2011
Showing with 22 additions and 2 deletions.
  1. +22 −2 src/com/bradsproject/com/bradsproject/BradleyJewell/bMobs/bMobs.java
@@ -18,11 +18,13 @@
import org.bukkit.entity.*;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event;
+import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.PluginManager;
-import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
+import com.nijiko.permissions.PermissionHandler;
+import com.nijikokun.bukkit.Permissions.Permissions;
/**
* bMobs for Bukkit
@@ -33,7 +35,7 @@
{
private final bMobsEntityListener entityListener = new bMobsEntityListener(this);
private final bMobsWorldListener worldListener = new bMobsWorldListener(this);
- public static AnjoPermissionsHandler Permissions = null;
+ public static PermissionHandler Permissions = null;
Server server;
Map<String, bMobsWorld> worlds = new HashMap<String, bMobsWorld>();
@@ -45,6 +47,8 @@ public void onEnable()
pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.WORLD_LOAD, worldListener, Priority.Normal, this);
+ setupPermissions();
+
try
{
parseProperties();
@@ -122,6 +126,22 @@ public void onDisable()
System.out.println("bMobs has been disabled!");
}
+ public void setupPermissions()
+ {
+ Plugin test = this.getServer().getPluginManager().getPlugin("Permissions");
+
+ if(bMobs.Permissions == null)
+ {
+ if(test != null)
+ {
+ bMobs.Permissions = ((Permissions) test).getHandler();
+ } else
+ {
+
+ }
+ }
+ }
+
public void parseProperties() throws FileNotFoundException, IOException
{
BufferedReader in = new BufferedReader(new FileReader("plugins/bMobs/bMobs.properties"));

0 comments on commit 24d8384

Please sign in to comment.