mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Merge branch 'master' of https://github.com/essentials/Essentials
This commit is contained in:
commit
26c9b34744
@ -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 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];
|
||||
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+group+" create");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" parents add "+group+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" perms add "+perm+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" has "+perm+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+group+" delete");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" parents remove "+group+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" perms remove "+perm+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions g:"+target+" perms list");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
}
|
||||
|
||||
ess.getServer().dispatchCommand(sender, "/permissions -reload "+world+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -22,6 +22,7 @@ public class Commandmanuadd extends EssentialsCommand
|
||||
}
|
||||
final String player = args[0];
|
||||
final String group = args[1];
|
||||
//TODO: Make this command add a player if it doesnt exist /permissions +player+ create
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" parents add "+group+"");
|
||||
}
|
||||
|
||||
|
@ -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+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" parents add "+group+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" has "+perm+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" delete");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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 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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" parents remove "+group+"");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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("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];
|
||||
ess.getServer().dispatchCommand(sender, "/permissions "+player+" perms list");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -7,6 +7,7 @@ import org.bukkit.event.player.PlayerListener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.event.block.Action;
|
||||
|
||||
|
||||
public class EssentialsProtectPlayerListener extends PlayerListener
|
||||
@ -45,7 +46,7 @@ public class EssentialsProtectPlayerListener extends PlayerListener
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.isAuthorized("essentials.protect.admin"))
|
||||
if (user.isAuthorized("essentials.protect.admin") && event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
||||
{
|
||||
final StringBuilder stringBuilder = new StringBuilder();
|
||||
boolean first = true;
|
||||
|
Loading…
Reference in New Issue
Block a user