Adding user permission alias

This commit is contained in:
KHobbits 2011-06-08 17:36:43 +01:00
parent 5d925aa338
commit f5fac6f9f5
4 changed files with 87 additions and 1 deletions

View file

@ -0,0 +1,29 @@
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];
ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms add "+perm+"");
}
}

View file

@ -0,0 +1,29 @@
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];
ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms remove "+perm+"");
}
}

View file

@ -10,7 +10,7 @@ public class Commandmanudelsub extends EssentialsCommand
{
public Commandmanudelsub()
{
super("manudel");
super("manudelsub");
}
@Override

View file

@ -0,0 +1,28 @@
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("manuaddp");
}
@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];
ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms list");
}
}