mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 10:33:43 +01:00 
			
		
		
		
	Fixed a few Array out of bounds errors, added confirmation messages for name color and prefix changes.
This commit is contained in:
		@@ -231,7 +231,13 @@ 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;
 | 
				
			||||||
        }       
 | 
					        }       
 | 
				
			||||||
        
 | 
					        //Name color
 | 
				
			||||||
 | 
					        if(args.length >= 1 && args[0] != null){
 | 
				
			||||||
 | 
					            player.setPrefix(args[0]);
 | 
				
			||||||
 | 
					            player.sendMessage(Colors.Rose + "Name color changed");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        //Prefix
 | 
				
			||||||
 | 
					        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(args[1].length() > 15)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -239,12 +245,8 @@ public class vMinecraftCommands{
 | 
				
			|||||||
            		+ "The prefix you entered was too long.");
 | 
					            		+ "The prefix you entered was too long.");
 | 
				
			||||||
            return EXIT_SUCCESS;
 | 
					            return EXIT_SUCCESS;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					           vMinecraftUsers.players.findProfile(player).setTag(args[1]);
 | 
				
			||||||
        if(args.length >= 1 && args[0] != null){
 | 
					           player.sendMessage(Colors.LightGreen + "Prefix changed");
 | 
				
			||||||
            player.setPrefix(args[1]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if(args.length >= 2 && args[1] != null){
 | 
					 | 
				
			||||||
           vMinecraftUsers.players.findProfile(player).setTag(args[2]);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return EXIT_SUCCESS;
 | 
					        return EXIT_SUCCESS;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user