From 338e0f18928f88f46c5c7cd342dcd5c5e799b5fc Mon Sep 17 00:00:00 2001 From: fooify Date: Tue, 1 Dec 2015 16:23:07 -0800 Subject: [PATCH] fixed naming pets non-alphanumeric characters --- .../mineplex/core/cosmetic/ui/page/PetTagPage.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java index 84da7d074..2846f791e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/cosmetic/ui/page/PetTagPage.java @@ -64,7 +64,16 @@ public class PetTagPage extends ShopPageBase { _tagName = ChatColor.stripColor(_tagName); _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) { UtilPlayer.message(getPlayer(), F.main(getPlugin().getName(), ChatColor.RED + "Pet name cannot be longer than 16 characters."));