Commits
md_5 authored 7deba1c6064
1311 1311 | recipient.sendMessage(message); |
1312 1312 | } |
1313 1313 | |
1314 1314 | return recipients.size(); |
1315 1315 | } |
1316 1316 | |
1317 1317 | |
1318 1318 | |
1319 1319 | public OfflinePlayer getOfflinePlayer(String name) { |
1320 1320 | Validate.notNull(name, "Name cannot be null"); |
1321 + | Validate.notEmpty(name, "Name cannot be empty"); |
1321 1322 | |
1322 1323 | OfflinePlayer result = getPlayerExact(name); |
1323 1324 | if (result == null) { |
1324 1325 | // This is potentially blocking :( |
1325 1326 | GameProfile profile = console.getUserCache().getProfile(name); |
1326 1327 | if (profile == null) { |
1327 1328 | // Make an OfflinePlayer using an offline mode UUID since the name has no profile |
1328 1329 | result = getOfflinePlayer(new GameProfile(UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)), name)); |
1329 1330 | } else { |
1330 1331 | // Use the GameProfile even when we get a UUID so we ensure we still have a name |