diff options
Diffstat (limited to 'EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions')
18 files changed, 567 insertions, 0 deletions
diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java new file mode 100644 index 000000000..442729f16 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangadd.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmangadd extends EssentialsCommand +{ + public Commandmangadd() + { + super("mangadd"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String group = args[0]; + String command = "/permissions g:" + group + " create"; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java new file mode 100644 index 000000000..f2eb55ee4 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddi.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmangaddi extends EssentialsCommand +{ + public Commandmangaddi() + { + super("mangaddi"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + final String group = args[1]; + String command = "/permissions g:"+target+" parents add "+group; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java new file mode 100644 index 000000000..e57628c57 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangaddp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmangaddp extends EssentialsCommand +{ + public Commandmangaddp() + { + super("mangaddp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + final String perm = args[1]; + String command = "/permissions g:"+target+" perms add "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java new file mode 100644 index 000000000..106dcd791 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangcheckp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmangcheckp extends EssentialsCommand +{ + public Commandmangcheckp() + { + super("mangcheckp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + final String perm = args[1]; + String command = "/permissions g:"+target+" has "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java new file mode 100644 index 000000000..52fdc3da2 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdel.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmangdel extends EssentialsCommand +{ + public Commandmangdel() + { + super("mangdel"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String group = args[0]; + String command = "/permissions g:"+group+" delete"; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java new file mode 100644 index 000000000..9b3bc3679 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdeli.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmangdeli extends EssentialsCommand +{ + public Commandmangdeli() + { + super("mangdeli"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + final String group = args[1]; + String command = "/permissions g:"+target+" parents remove "+group; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java new file mode 100644 index 000000000..de4ce8a7e --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmangdelp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmangdelp extends EssentialsCommand +{ + public Commandmangdelp() + { + super("mangdelp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 2) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + final String perm = args[1]; + String command = "/permissions g:"+target+" perms remove "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java new file mode 100644 index 000000000..2e775c147 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanglistp.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmanglistp extends EssentialsCommand +{ + public Commandmanglistp() + { + super("manglistp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String target = args[0]; + String command = "/permissions g:"+target+" perms list"; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java new file mode 100644 index 000000000..3e1803233 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanload.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmanload extends EssentialsCommand +{ + public Commandmanload() + { + super("manload"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + String world = "all"; + if (args.length > 1) + { + world = args[0]; + } + String command = "/permissions -reload "+world; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java new file mode 100644 index 000000000..65a4df759 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuadd.java @@ -0,0 +1,32 @@ +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; + + +public class Commandmanuadd extends EssentialsCommand +{ + public Commandmanuadd() + { + super("manuadd"); + } + + @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]; + //TODO: Make this command add a player if it doesnt exist /permissions +player+ create + String command = "/permissions "+player+" parents add "+group; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java new file mode 100644 index 000000000..676631c63 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmanuaddp extends EssentialsCommand +{ + public Commandmanuaddp() + { + super("manuaddp"); + } + + @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 perm = args[1]; + String command = "/permissions "+player+" perms add "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java new file mode 100644 index 000000000..ee2cd3147 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanuaddsub.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmanuaddsub extends EssentialsCommand +{ + public Commandmanuaddsub() + { + super("manuaddsub"); + } + + @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]; + String command = "/permissions "+player+" parents add "+group; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java new file mode 100644 index 000000000..df713fc31 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanucheckp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmanucheckp extends EssentialsCommand +{ + public Commandmanucheckp() + { + super("manucheckp"); + } + + @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 perm = args[1]; + String command = "/permissions "+player+" has "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java new file mode 100644 index 000000000..9e117ac21 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudel.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmanudel extends EssentialsCommand +{ + public Commandmanudel() + { + super("manudel"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String player = args[0]; + String command = "/permissions "+player+" delete"; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java new file mode 100644 index 000000000..4a35f628b --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelp.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmanudelp extends EssentialsCommand +{ + public Commandmanudelp() + { + super("manudelp"); + } + + @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 perm = args[1]; + String command = "/permissions "+player+" perms remove "+perm; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java new file mode 100644 index 000000000..4640c68b1 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanudelsub.java @@ -0,0 +1,31 @@ +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; + + +public class Commandmanudelsub extends EssentialsCommand +{ + public Commandmanudelsub() + { + super("manudelsub"); + } + + @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]; + String command = "/permissions "+player+" parents remove "+group; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java new file mode 100644 index 000000000..f5d4a484e --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/Commandmanulistp.java @@ -0,0 +1,30 @@ +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; + + +public class Commandmanulistp extends EssentialsCommand +{ + public Commandmanulistp() + { + super("manulistp"); + } + + @Override + protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + final String player = args[0]; + String command = "/permissions "+player+" perms list"; + sender.sendMessage(commandLabel + " is deprecated. Use " + command + " instead."); + ess.getServer().dispatchCommand(sender, command); + } + + +} diff --git a/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java new file mode 100644 index 000000000..e3c3f1dd6 --- /dev/null +++ b/EssentialsPermissionsCommands/src/com/earth2me/essentials/permissions/EssentialsPermissionsCommands.java @@ -0,0 +1,45 @@ +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 + public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) + { + return Essentials.getStatic().onCommandEssentials(sender, command, label, args, EssentialsPermissionsCommands.class.getClassLoader(), "com.earth2me.essentials.permissions.Command"); + } + + @Override + public void onDisable() + { + } +} |