aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-08-22 18:16:04 +0900
committersyeyoung <cyong06@naver.com>2021-08-22 18:16:44 +0900
commit91f20ae728578f1a39c2a842d21b94ba246f4842 (patch)
treea33743e4d5b510e8793b3eeec55cd2b7255ade78 /src/main/java/kr
parent93e67ad692e25c0d13d63271a3536c16571aebd0 (diff)
downloadSkyblock-Dungeons-Guide-91f20ae728578f1a39c2a842d21b94ba246f4842.tar.gz
Skyblock-Dungeons-Guide-91f20ae728578f1a39c2a842d21b94ba246f4842.tar.bz2
Skyblock-Dungeons-Guide-91f20ae728578f1a39c2a842d21b94ba246f4842.zip
- Fix cosmetics not working in private islands when current player is the one who sent message
Diffstat (limited to 'src/main/java/kr')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java
index 28fb861e..5b08aeb2 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerChatByMe.java
@@ -57,12 +57,13 @@ public class ChatReplacerChatByMe implements IChatReplacer {
ChatStyle origStyle = hasMsg.get(0).getChatStyle();
String name = chatComponents.getFormattedText();
+ System.out.println(name);
String[] splited = name.split(" ");
String actualName = splited[splited.length-1];
List<ActiveCosmetic> cDatas = cosmeticsManager.getActiveCosmeticByPlayerNameLowerCase().get(TextUtils.stripColor(actualName).toLowerCase());
- if (cDatas == null || splited.length > 2) return;
+ if (cDatas == null) return;
CosmeticData color=null, prefix=null;
for (ActiveCosmetic activeCosmetic : cDatas) {
CosmeticData cosmeticData = cosmeticsManager.getCosmeticDataMap().get(activeCosmetic.getCosmeticData());
@@ -75,10 +76,12 @@ public class ChatReplacerChatByMe implements IChatReplacer {
String building = "";
if (prefix != null) building += prefix.getData().replace("&", "§") + " ";
- if (splited.length == 2) building += splited[0] +" ";
+ for (int i = 0; i < splited.length-1; i++) {
+ building += splited[i] +" ";
+ }
if (color != null) {
- String nick = splited[1];
+ String nick = splited[splited.length-1];
building += color.getData().replace("&","§");
boolean foundLegitChar = false;
boolean foundColor = false;
@@ -93,7 +96,7 @@ public class ChatReplacerChatByMe implements IChatReplacer {
}
}
} else {
- building += splited[1] ;
+ building += splited[splited.length-1] ;
}
ChatComponentText chatComponents1 = new ChatComponentText(building);