mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-19 13:01:20 +02:00
regex check on banip command format if player name is not found
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
|
||||
{
|
||||
|
Reference in New Issue
Block a user