mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-21 22:06:22 +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}
|
recipeGridItem=\ \u00a7{0}X \u00a76is \u00a7c{1}
|
||||||
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
|
recipeMore=\u00a76Type /{0} \u00a7c{1}\u00a76 <number> to see other recipes for \u00a7c{2}
|
||||||
recipeWhere=\u00a76Where: {0}
|
recipeWhere=\u00a76Where: {0}
|
||||||
|
invalidIpAddress=\u00a74Invalid IP address
|
||||||
#, java-format
|
#, java-format
|
||||||
Hello\ {0},\ how\ are\ you?=\u00a7fHello \u00a74{0}\u00a7f, how are you?
|
Hello\ {0},\ how\ are\ you?=\u00a7fHello \u00a74{0}\u00a7f, how are you?
|
||||||
|
@@ -18,11 +18,18 @@ public class Commandbanip extends EssentialsCommand
|
|||||||
final IUser player = ess.getUserMap().getUser(args[0]);
|
final IUser player = ess.getUserMap().getUser(args[0]);
|
||||||
|
|
||||||
if (player == null)
|
if (player == null)
|
||||||
|
{
|
||||||
|
if(args[0].matches("\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b"))
|
||||||
{
|
{
|
||||||
ess.getServer().banIP(args[0]);
|
ess.getServer().banIP(args[0]);
|
||||||
sender.sendMessage(_("banIpAddress"));
|
sender.sendMessage(_("banIpAddress"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
sender.sendMessage(_("invalidIpAddress"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
final String ipAddress = player.getData().getIpAddress();
|
final String ipAddress = player.getData().getIpAddress();
|
||||||
if (ipAddress.length() == 0)
|
if (ipAddress.length() == 0)
|
||||||
|
@@ -47,7 +47,7 @@ public class Commandrepair extends EssentialsCommand
|
|||||||
|
|
||||||
user.sendMessage(_("repair", itemName.replace('_', ' ')));
|
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);
|
final Trade charge = new Trade("repair-all", ess);
|
||||||
charge.isAffordableFor(user);
|
charge.isAffordableFor(user);
|
||||||
|
@@ -84,6 +84,7 @@ public enum Permissions implements IPermission
|
|||||||
POWERTOOL_APPEND,
|
POWERTOOL_APPEND,
|
||||||
PTIME_OTHERS,
|
PTIME_OTHERS,
|
||||||
PVPDELAY_EXEMPT,
|
PVPDELAY_EXEMPT,
|
||||||
|
REPAIR_ALL,
|
||||||
REPAIR_ARMOR,
|
REPAIR_ARMOR,
|
||||||
REPAIR_ENCHANTED,
|
REPAIR_ENCHANTED,
|
||||||
SEEN_BANREASON,
|
SEEN_BANREASON,
|
||||||
|
Reference in New Issue
Block a user