mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-21 05:51:56 +02:00
Merge pull request #437 from Riaku/master
regex Check on banip essentials.repair.all permission node
This commit is contained in:
@@ -505,5 +505,6 @@ recipeGrid=\u00a7{0}X \u00a76| \u00a7{1}X \u00a76| \u00a7{2}X
|
||||
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
|
||||
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
|
||||
recipeWhere=\u00a76Where: {0}
|
||||
invalidIpAddress=\u00a74Invalid IP address
|
||||
#, java-format
|
||||
Hello\ {0},\ how\ are\ you?=\u00a7fHello \u00a74{0}\u00a7f, how are you?
|
||||
|
@@ -19,8 +19,15 @@ public class Commandbanip extends EssentialsCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
ess.getServer().banIP(args[0]);
|
||||
sender.sendMessage(_("banIpAddress"));
|
||||
if(args[0].matches("\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b"))
|
||||
{
|
||||
ess.getServer().banIP(args[0]);
|
||||
sender.sendMessage(_("banIpAddress"));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(_("invalidIpAddress"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ public class Commandrepair extends EssentialsCommand
|
||||
|
||||
user.sendMessage(_("repair", itemName.replace('_', ' ')));
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("all"))
|
||||
else if (args[0].equalsIgnoreCase("all") && Permissions.REPAIR_ALL.isAuthorized(user))
|
||||
{
|
||||
final Trade charge = new Trade("repair-all", ess);
|
||||
charge.isAffordableFor(user);
|
||||
|
@@ -84,6 +84,7 @@ public enum Permissions implements IPermission
|
||||
POWERTOOL_APPEND,
|
||||
PTIME_OTHERS,
|
||||
PVPDELAY_EXEMPT,
|
||||
REPAIR_ALL,
|
||||
REPAIR_ARMOR,
|
||||
REPAIR_ENCHANTED,
|
||||
SEEN_BANREASON,
|
||||
|
Reference in New Issue
Block a user