Skip to content

Commit

Permalink
change string name
Browse files Browse the repository at this point in the history
  • Loading branch information
CalMWolfs committed Mar 11, 2024
1 parent c73f98e commit 6c71705
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ private IChatComponent replaceSocialControlsWithPV(IChatComponent chatComponent)

IChatComponent targetedComponent = siblings.get(siblings.size() - 2);

String startsWith = getChatClickEvent(siblings.get(0));
String chatClickCommand = getChatClickEvent(siblings.get(0));

if (startsWith == null) {
startsWith = getChatClickEvent(targetedComponent);
if (chatClickCommand == null) {
chatClickCommand = getChatClickEvent(targetedComponent);
}
if (startsWith == null) return chatComponent;
if (chatClickCommand == null) return chatComponent;

String username = startsWith.equals("/viewprofile") ?
String username = chatClickCommand.equals("/viewprofile") ?
Utils.getNameFromChatComponent(chatComponent) :
targetedComponent.getChatStyle().getChatClickEvent().getValue().substring(15);
username = username.replaceAll("[^a-zA-Z0-9_]", "");
Expand Down

0 comments on commit 6c71705

Please sign in to comment.