mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Minor bug with error checking with /prefix
This commit is contained in:
parent
88c8787293
commit
14119657df
@ -185,6 +185,14 @@ public class vMinecraftCommands{
|
|||||||
//if the player can prefix others
|
//if the player can prefix others
|
||||||
if(player.canUseCommand("/prefixother")){
|
if(player.canUseCommand("/prefixother")){
|
||||||
|
|
||||||
|
//Check if there are enough arguments
|
||||||
|
if(args.length < 2){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose + "Usage is /prefix [Color Code] <Tag>");
|
||||||
|
player.sendMessage(Colors.DarkPurple + "Example: /prefix " + player.getName() + " e ^0[^a<3^0]");
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.DarkPurple + "This would produce a name like... " + Colors.Black + "[" + Colors.LightGreen + "<3" + Colors.Black + "]" + Colors.Yellow + player.getName());
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//Check if the nickname is too long
|
//Check if the nickname is too long
|
||||||
if(args[1].length() > 10)
|
if(args[1].length() > 10)
|
||||||
{
|
{
|
||||||
@ -202,14 +210,6 @@ public class vMinecraftCommands{
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if there are enough arguments
|
|
||||||
if(args.length < 2){
|
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose + "Usage is /prefix [Color Code] <Tag>");
|
|
||||||
player.sendMessage(Colors.DarkPurple + "Example: /prefix " + player.getName() + " e ^0[^a<3^0]");
|
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.DarkPurple + "This would produce a name like... " + Colors.Black + "[" + Colors.LightGreen + "<3" + Colors.Black + "]" + Colors.Yellow + player.getName());
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(args.length >= 2 && args[0] != null){
|
if(args.length >= 2 && args[0] != null){
|
||||||
player.setPrefix(args[1]);
|
player.setPrefix(args[1]);
|
||||||
}
|
}
|
||||||
@ -231,6 +231,7 @@ public class vMinecraftCommands{
|
|||||||
vMinecraftChat.sendMessage(player, player, Colors.DarkPurple + "This would produce a name like... " + Colors.Black + "[" + Colors.LightGreen + "<3" + Colors.Black + "]" + Colors.Yellow + player.getName());
|
vMinecraftChat.sendMessage(player, player, Colors.DarkPurple + "This would produce a name like... " + Colors.Black + "[" + Colors.LightGreen + "<3" + Colors.Black + "]" + Colors.Yellow + player.getName());
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(args.length >= 1 && args[0] != null){
|
if(args.length >= 1 && args[0] != null){
|
||||||
player.setPrefix(args[1]);
|
player.setPrefix(args[1]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user