mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Changed how prefix length is calculated
This commit is contained in:
parent
8085b43258
commit
a6de66f825
@ -110,7 +110,7 @@ public class vMinecraftChat {
|
|||||||
//Output: int: The length on the screen of a string
|
//Output: int: The length on the screen of a string
|
||||||
//Use: Finds the length on the screen of a string. Ignores colors.
|
//Use: Finds the length on the screen of a string. Ignores colors.
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
private static int msgLength(String str){
|
public static int msgLength(String str){
|
||||||
int length = 0;
|
int length = 0;
|
||||||
//Loop through all the characters, skipping any color characters
|
//Loop through all the characters, skipping any color characters
|
||||||
//and their following color codes
|
//and their following color codes
|
||||||
|
@ -194,7 +194,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the prefix is too long
|
//Check if the prefix is too long
|
||||||
if(args[1].length() > 15)
|
if(vMinecraftChat.msgLength(args[1]) > 60)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The prefix you entered was too long.");
|
+ "The prefix you entered was too long.");
|
||||||
@ -237,7 +237,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
if(args.length >= 2 && args[1] != null){
|
if(args.length >= 2 && args[1] != null){
|
||||||
//Check if the prefix is too long
|
//Check if the prefix is too long
|
||||||
if(args[1].length() > 15)
|
if(vMinecraftChat.msgLength(args[1]) > 60)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The prefix you entered was too long.");
|
+ "The prefix you entered was too long.");
|
||||||
@ -266,7 +266,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the nickname is too long
|
//Check if the nickname is too long
|
||||||
if(args[1].length() > 30)
|
if(vMinecraftChat.msgLength(args[1]) > 85)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The suffix you entered was too long.");
|
||||||
@ -292,7 +292,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the nickname is too long
|
//Check if the nickname is too long
|
||||||
if(args[0].length() > 30)
|
if(vMinecraftChat.msgLength(args[1]) > 85)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The suffix you entered was too long.");
|
||||||
@ -327,7 +327,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the suffix is too long
|
//Check if the suffix is too long
|
||||||
if(args[1].length() > 20)
|
if(vMinecraftChat.msgLength(args[1]) > 60)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The suffix you entered was too long.");
|
||||||
@ -358,7 +358,7 @@ public class vMinecraftCommands{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the suffix is too long
|
//Check if the suffix is too long
|
||||||
if(args[0].length() > 20)
|
if(vMinecraftChat.msgLength(args[1]) > 60)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The suffix you entered was too long.");
|
||||||
|
Loading…
Reference in New Issue
Block a user