From 5a295074e2721fdb6e7a106edfb5c9fc4b8972e9 Mon Sep 17 00:00:00 2001 From: cerevisiae Date: Thu, 9 Dec 2010 21:50:39 -0600 Subject: [PATCH] Minor bug with error checking with /prefix --- vMinecraftCommands.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/vMinecraftCommands.java b/vMinecraftCommands.java index 054a14718..1801943c0 100644 --- a/vMinecraftCommands.java +++ b/vMinecraftCommands.java @@ -193,8 +193,8 @@ public class vMinecraftCommands{ return EXIT_SUCCESS; } - //Check if the nickname is too long - if(args[1].length() > 10) + //Check if the prefix is too long + if(args[1].length() > 15) { vMinecraftChat.sendMessage(player, player, Colors.Rose + "The prefix you entered was too long."); @@ -232,6 +232,14 @@ public class vMinecraftCommands{ return EXIT_SUCCESS; } + //Check if the prefix is too long + if(args[1].length() > 15) + { + vMinecraftChat.sendMessage(player, player, Colors.Rose + + "The prefix you entered was too long."); + return EXIT_SUCCESS; + } + if(args.length >= 1 && args[0] != null){ player.setPrefix(args[1]); } @@ -259,7 +267,7 @@ public class vMinecraftCommands{ } //Check if the nickname is too long - if(args[1].length() > 20) + if(args[1].length() > 30) { vMinecraftChat.sendMessage(player, player, Colors.Rose + "The suffix you entered was too long."); @@ -285,7 +293,7 @@ public class vMinecraftCommands{ } //Check if the nickname is too long - if(args[0].length() > 20) + if(args[0].length() > 30) { vMinecraftChat.sendMessage(player, player, Colors.Rose + "The suffix you entered was too long."); @@ -320,7 +328,7 @@ public class vMinecraftCommands{ } //Check if the suffix is too long - if(args[1].length() > 10) + if(args[1].length() > 20) { vMinecraftChat.sendMessage(player, player, Colors.Rose + "The suffix you entered was too long."); @@ -351,7 +359,7 @@ public class vMinecraftCommands{ } //Check if the suffix is too long - if(args[0].length() > 10) + if(args[0].length() > 20) { vMinecraftChat.sendMessage(player, player, Colors.Rose + "The suffix you entered was too long.");