From 4bfc8e1459354f82658e41aec9231c5129dff70d Mon Sep 17 00:00:00 2001 From: snowleo Date: Tue, 7 Jun 2011 00:54:36 +0200 Subject: Cleanup /manuadd command --- BuildAll/nbproject/build-impl.xml | 28 ++++++++++++++++++++++ BuildAll/nbproject/genfiles.properties | 6 ++--- BuildAll/nbproject/project.properties | 8 ++++++- BuildAll/nbproject/project.xml | 16 +++++++++++++ .../src/com/earth2me/essentials/Essentials.java | 2 +- .../essentials/permissions/Commandmanuadd.java | 9 ++++++- .../permissions/EssentialsPermissionsCommands.java | 19 +++++++++++++++ EssentialsPermissionsCommands/src/plugin.yml | 2 +- 8 files changed, 83 insertions(+), 7 deletions(-) diff --git a/BuildAll/nbproject/build-impl.xml b/BuildAll/nbproject/build-impl.xml index 576a464dd..4d03d5c8d 100644 --- a/BuildAll/nbproject/build-impl.xml +++ b/BuildAll/nbproject/build-impl.xml @@ -622,6 +622,20 @@ is divided into following sections: + + + + + + + + + + + + + + @@ -1107,6 +1121,20 @@ is divided into following sections: + + + + + + + + + + + + + + diff --git a/BuildAll/nbproject/genfiles.properties b/BuildAll/nbproject/genfiles.properties index c5989c1d3..cd7a3420b 100644 --- a/BuildAll/nbproject/genfiles.properties +++ b/BuildAll/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=2eb9432b +build.xml.data.CRC32=2bd2dd75 build.xml.script.CRC32=7a797370 build.xml.stylesheet.CRC32=28e38971@1.43.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=2eb9432b -nbproject/build-impl.xml.script.CRC32=f6f34008 +nbproject/build-impl.xml.data.CRC32=2bd2dd75 +nbproject/build-impl.xml.script.CRC32=769e541b nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/BuildAll/nbproject/project.properties b/BuildAll/nbproject/project.properties index ec2dbb574..552d04116 100644 --- a/BuildAll/nbproject/project.properties +++ b/BuildAll/nbproject/project.properties @@ -35,7 +35,9 @@ javac.classpath=\ ${reference.EssentialsPermissionsCommands.jar}:\ ${reference.EssentialsSpawn.jar}:\ ${reference.EssentialsGeoIP.jar}:\ - ${reference.EssentialsXMPP.jar} + ${reference.EssentialsXMPP.jar}:\ + ${reference.EssentialsGroupBridge.jar}:\ + ${reference.EssentialsGroupManager.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -67,6 +69,8 @@ platform.active=default_platform project.Essentials=../Essentials project.EssentialsChat=../EssentialsChat project.EssentialsGeoIP=../EssentialsGeoIP +project.EssentialsGroupBridge=../EssentialsGroupBridge +project.EssentialsGroupManager=../EssentialsGroupManager project.EssentialsPermissionsCommands=../EssentialsPermissionsCommands project.EssentialsProtect=../EssentialsProtect project.EssentialsSpawn=../EssentialsSpawn @@ -74,6 +78,8 @@ project.EssentialsXMPP=../EssentialsXMPP reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar reference.EssentialsChat.jar=${project.EssentialsChat}/dist/EssentialsChat.jar reference.EssentialsGeoIP.jar=${project.EssentialsGeoIP}/dist/EssentialsGeoIP.jar +reference.EssentialsGroupBridge.jar=${project.EssentialsGroupBridge}/dist/EssentialsGroupBridge.jar +reference.EssentialsGroupManager.jar=${project.EssentialsGroupManager}/dist/EssentialsGroupManager.jar reference.EssentialsPermissionsCommands.jar=${project.EssentialsPermissionsCommands}/dist/EssentialsPermissionsCommands.jar reference.EssentialsProtect.jar=${project.EssentialsProtect}/dist/EssentialsProtect.jar reference.EssentialsSpawn.jar=${project.EssentialsSpawn}/dist/EssentialsSpawn.jar diff --git a/BuildAll/nbproject/project.xml b/BuildAll/nbproject/project.xml index 16460d7fc..cda8261b6 100644 --- a/BuildAll/nbproject/project.xml +++ b/BuildAll/nbproject/project.xml @@ -39,6 +39,22 @@ clean jar + + EssentialsGroupBridge + jar + + jar + clean + jar + + + EssentialsGroupManager + jar + + jar + clean + jar + EssentialsPermissionsCommands jar diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 2b30c5b02..5d3d8d9f1 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -115,7 +115,7 @@ public class Essentials extends JavaPlugin implements IEssentials backup = new Backup(this); essDep = new EssentialsDependancyChecker(this); - PluginManager pm = getServer().getPluginManager(); + final PluginManager pm = getServer().getPluginManager(); for (Plugin plugin : pm.getPlugins()) { if (plugin.getDescription().getName().startsWith("Essentials")) 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 -- cgit v1.2.3