From 4a71af39afafff3d0080d36748411b4a9512f8d1 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sun, 9 Jul 2017 17:30:26 +0100 Subject: [PATCH] Return account by normal name if name is longer than 15 cars (DevBukkit-1217) --- src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java index 7289945..35a9629 100644 --- a/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java +++ b/src/main/java/com/Acrobot/ChestShop/UUIDs/NameManager.java @@ -93,11 +93,13 @@ public class NameManager { * Get account info from a username that might be shortened * @param shortName The name of the player to get the account info * @return The account info or null if none was found - * @throws IllegalArgumentException if the username is not a shortened name and longer than 15 chars + * @throws IllegalArgumentException if the username is empty */ public static Account getAccountFromShortName(String shortName) { Validate.notEmpty(shortName, "shortName cannot be null or empty!"); - Validate.isTrue(shortName.length() < 16, "Username is not a shortened name and longer than 15 chars!"); + if (shortName.length() > 15) { + return getAccount(shortName); + } try { return shortToAccount.get(shortName, () -> {