Source:
private User getPlayer(final Server server, final User sourceUser, final String searchTerm, final boolean getHidden, final boolean getOffline) throws PlayerNotFoundException { final User user; Player exPlayer; try { exPlayer = server.getPlayer(UUID.fromString(searchTerm)); } catch (final IllegalArgumentException ex) { if (getOffline) { exPlayer = server.getPlayerExact(searchTerm); } else { exPlayer = server.getPlayer(searchTerm); } } if (exPlayer != null) { user = ess.getUser(exPlayer); } else { Object searchId; try { searchId = UUID.fromString(searchTerm); }catch(final IllegalArgumentException ex) { searchId = searchTerm; } if (searchId instanceof String) { user = ess.getUser((String) searchId); } else { user = ess.getUser((UUID) searchId); } } if (user != null) { if (!getOffline && !user.getBase().isOnline()) { throw new PlayerNotFoundException(); } if (getHidden || canInteractWith(sourceUser, user)) { return user; } else { if (getOffline && user.getName().equalsIgnoreCase(searchTerm)) { return user; } } throw new PlayerNotFoundException(); } final List<Player> matches = server.matchPlayer(searchTerm); if (matches.isEmpty()) { final String matchText = searchTerm.toLowerCase(Locale.ENGLISH); for (final User userMatch : ess.getOnlineUsers()) { if (getHidden || canInteractWith(sourceUser, userMatch)) { final String displayName = FormatUtil.stripFormat(userMatch.getDisplayName()).toLowerCase(Locale.ENGLISH); if (displayName.contains(matchText)) { return userMatch; } } } } else { for (final Player player : matches) { final User userMatch = ess.getUser(player); if (userMatch.getDisplayName().startsWith(searchTerm) && (getHidden || canInteractWith(sourceUser, userMatch))) { return userMatch; } } final User userMatch = ess.getUser(matches.get(0)); if (getHidden || canInteractWith(sourceUser, userMatch)) { return userMatch; } } throw new PlayerNotFoundException(); }

Target:
private User getPlayer(final Server server, final User sourceUser, final String searchTerm, final boolean getHidden, final boolean getOffline) throws PlayerNotFoundException { final User user; Player exPlayer; try { exPlayer = server.getPlayer(UUID.fromString(searchTerm)); } catch (final IllegalArgumentException ex) { if (getOffline) { exPlayer = server.getPlayerExact(searchTerm); } else { exPlayer = server.getPlayer(searchTerm); } } if (exPlayer != null) { user = ess.getUser(exPlayer); } else { User mutableUser; try { mutableUser = ess.getUser(UUID.fromString(searchTerm)); } catch(final IllegalArgumentException ex) { mutableUser = ess.getUser(searchTerm); } user = mutableUser; } if (user != null) { if (!getOffline && !user.getBase().isOnline()) { throw new PlayerNotFoundException(); } if (getHidden || canInteractWith(sourceUser, user)) { return user; } else { if (getOffline && user.getName().equalsIgnoreCase(searchTerm)) { return user; } } throw new PlayerNotFoundException(); } final List<Player> matches = server.matchPlayer(searchTerm); if (matches.isEmpty()) { final String matchText = searchTerm.toLowerCase(Locale.ENGLISH); for (final User userMatch : ess.getOnlineUsers()) { if (getHidden || canInteractWith(sourceUser, userMatch)) { final String displayName = FormatUtil.stripFormat(userMatch.getDisplayName()).toLowerCase(Locale.ENGLISH); if (displayName.contains(matchText)) { return userMatch; } } } } else { for (final Player player : matches) { final User userMatch = ess.getUser(player); if (userMatch.getDisplayName().startsWith(searchTerm) && (getHidden || canInteractWith(sourceUser, userMatch))) { return userMatch; } } final User userMatch = ess.getUser(matches.get(0)); if (getHidden || canInteractWith(sourceUser, userMatch)) { return userMatch; } } throw new PlayerNotFoundException(); }