fixed naming pets non-alphanumeric characters
This commit is contained in:
parent
48ae23ebff
commit
338e0f1892
@ -64,7 +64,16 @@ public class PetTagPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
|||||||
{
|
{
|
||||||
_tagName = ChatColor.stripColor(_tagName);
|
_tagName = ChatColor.stripColor(_tagName);
|
||||||
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
|
_tagName = _tagName.replaceAll("[^A-Za-z0-9]", "");
|
||||||
|
System.out.println("Pet name: " + _tagName + ".");
|
||||||
|
if (_tagName.length() == 0)
|
||||||
|
{
|
||||||
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Supplied pet name contains invalid characters."));
|
||||||
|
playDenySound(getPlayer());
|
||||||
|
|
||||||
|
getShop().openPageForPlayer(getPlayer(), new PetPage(getPlugin(), getShop(), getClientManager(), getDonationManager(), "Pets", getPlayer()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (_tagName.length() > 16)
|
if (_tagName.length() > 16)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));
|
UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));
|
||||||
|
Loading…
Reference in New Issue
Block a user