diff --git a/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java b/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java index c3536df..01c983a 100644 --- a/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java +++ b/src/main/java/org/polyfrost/hytils/handlers/chat/modules/modifiers/DefaultChatRestyler.java @@ -102,10 +102,10 @@ public void onMessageReceived(@NotNull ClientChatReceivedEvent event) { Matcher privateMessageFromMatcher = language.chatRestylerPrivateMessageFromPatternRegex.matcher(message); if (privateMessageToMatcher.find()) { event.message = shortenChannelName(event.message, language.chatRestylerPrivateMessageToPatternRegex.pattern(), - "§d" + "PM >", true); + "§d" + "PM >" + privateMessageToMatcher.group(3) + ":" + privateMessageToMatcher.group(4), true); } else if (privateMessageFromMatcher.find()) { event.message = shortenChannelName(event.message, language.chatRestylerPrivateMessageFromPatternRegex.pattern(), - "§5" + "PM <", true); + "§5" + "PM <" + privateMessageFromMatcher.group(3) + ":" + privateMessageFromMatcher.group(4), true); } } diff --git a/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java b/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java index c3be347..1c93a49 100644 --- a/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java +++ b/src/main/java/org/polyfrost/hytils/handlers/language/LanguageData.java @@ -80,8 +80,8 @@ public class LanguageData { private String chatRestylerFriendPattern = "^((?:\u00a7r)?\u00a7\\w)(Friend >)"; private String chatRestylerOfficerPattern = "^((?:\u00a7r)?\u00a7\\w)(Officer >)"; private String chatRestylerStatusPattern = "^(?(?:\u00a7aFriend|\u00a7a\u00a7aF|\u00a72Guild|\u00a72\u00a72G)) > (\u00a7r|\u00a7r\u00a7r){1,2}(?\u00a7[\\da-f]\\w{1,16}) \u00a7r\u00a7e(?(?:joined|left))\\.\u00a7r$"; - private String chatRestylerPrivateMessageToPattern = "^((?:\u00a7r)?\u00a7\\w)(To)"; - private String chatRestylerPrivateMessageFromPattern = "^((?:\u00a7r)?\u00a7\\w)(From)"; + private String chatRestylerPrivateMessageToPattern = "^((?:\u00a7r)?\u00a7\\w)(To)([^:]*):(.*)"; + private String chatRestylerPrivateMessageFromPattern = "^((?:\u00a7r)?\u00a7\\w)(From)([^:]*):(.*)"; private String autoChatSwapperPartyStatus = "^(?:You have been kicked from the party by (?:\\[.+] )?\\w{1,16}|(?:\\[.+] )?\\w{1,16} has disbanded the party!|You left the party.)$"; private String autoChatSwapperPartyStatus2 = "^(?:You have joined (?:\\[.+] )?(?:.*)|Party Members(?:\\[.+] )?\\w{1,100}|(?:\\[.+] )?\\w{1,100} joined the(?:.*) party(?:.*))$";