summaryrefslogtreecommitdiffstats
path: root/EssentialsPermissionsCommands/src
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-06-07 00:54:36 +0200
committersnowleo <schneeleo@gmail.com>2011-06-07 00:54:36 +0200
commitfb6f13cc883f80b1a9655da054009d2be9b3fb8a (patch)
treed678ca3f03976185cbadfe797565ab8d5a5f12ef /EssentialsPermissionsCommands/src
parentcc22792d7904ed93a676cecbb31201ea0163bfab (diff)
downloadEssentials-fb6f13cc883f80b1a9655da054009d2be9b3fb8a.tar
Essentials-fb6f13cc883f80b1a9655da054009d2be9b3fb8a.tar.gz
Essentials-fb6f13cc883f80b1a9655da054009d2be9b3fb8a.tar.lz
Essentials-fb6f13cc883f80b1a9655da054009d2be9b3fb8a.tar.xz
Essentials-fb6f13cc883f80b1a9655da054009d2be9b3fb8a.zip
Cleanup
/manuadd command
Diffstat (limited to 'EssentialsPermissionsCommands/src')
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java9
-rw-r--r--EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java19
-rw-r--r--EssentialsPermissionsCommands/src/plugin.yml2
3 files changed, 28 insertions, 2 deletions
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
index 1f41b890a..8515aaea7 100644
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.permissions;
import com.earth2me.essentials.commands.EssentialsCommand;
+import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -15,7 +16,13 @@ public class Commandmanuadd extends EssentialsCommand
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
-
+ if (args.length < 2)
+ {
+ throw new NotEnoughArgumentsException();
+ }
+ final String player = args[0];
+ final String group = args[1];
+ ess.getServer().dispatchCommand(sender, "/permissions "+player+" parents add "+group+"");
}
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
index f8af12f28..e3c3f1dd6 100644
--- a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
+++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java
@@ -1,16 +1,35 @@
package com.earth2me.essentials.permissions;
import com.earth2me.essentials.Essentials;
+import com.nijiko.permissions.PermissionHandler;
+import com.nijikokun.bukkit.Permissions.Permissions;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public class EssentialsPermissionsCommands extends JavaPlugin
{
+ private static PermissionHandler permissionHandler = null;
+
+ public static PermissionHandler getPermissionHandler()
+ {
+ return permissionHandler;
+ }
+
@Override
public void onEnable()
{
+ final PluginManager pluginManager = getServer().getPluginManager();
+ final Plugin permissionsPlugin = pluginManager.getPlugin("Permissions");
+
+ if (permissionsPlugin != null
+ && permissionsPlugin.getDescription().getVersion().charAt(0) == '3')
+ {
+ permissionHandler = ((Permissions)permissionsPlugin).getHandler();
+ }
}
@Override
diff --git a/EssentialsPermissionsCommands/src/plugin.yml b/EssentialsPermissionsCommands/src/plugin.yml
index 3d75176a7..54425b716 100644
--- a/EssentialsPermissionsCommands/src/plugin.yml
+++ b/EssentialsPermissionsCommands/src/plugin.yml
@@ -1,5 +1,5 @@
# This determines the command prefix when there are conflicts (/name:home, /name:help, etc.)
-name: Essentials
+name: EssentialsPermissionsCommands
main: com.earth2me.essentials.permissions.EssentialsPermissionsCommands
# Note to developers: This next line cannot change, or the automatic versioning system will break.
version: TeamCity