diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/src/main/java/de/hype/bbsentials/common/chat/Message.java | 6 | ||||
-rw-r--r-- | common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/common/src/main/java/de/hype/bbsentials/common/chat/Message.java b/common/src/main/java/de/hype/bbsentials/common/chat/Message.java index 51f0646..7fce889 100644 --- a/common/src/main/java/de/hype/bbsentials/common/chat/Message.java +++ b/common/src/main/java/de/hype/bbsentials/common/chat/Message.java @@ -46,7 +46,7 @@ public class Message { public String getMessageContent() { if (isServerMessage()) return unformattedString; - return getUnformattedString().split(":", 2)[1]; + return getUnformattedString().split(":", 2)[1].trim(); } Boolean guild = null; @@ -77,9 +77,7 @@ public class Message { public boolean isServerMessage() { if (server != null) return server; - int space = getUnformattedString().indexOf(" "); - int doublepoint = getUnformattedString().indexOf(":"); - return ((space + 2 < doublepoint)||doublepoint==-1||space==-1); + return !(isFromParty() || isFromGuild() || isMsg()); } public String getPlayerName() { diff --git a/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java b/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java index 59f5bee..9a5be33 100644 --- a/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java +++ b/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java @@ -445,7 +445,7 @@ public class BBsentialConnection { public void onPartyPacket(PartyPacket packet) { if (BBsentials.config.allowServerPartyInvite) { - Chat.sendCommand("/p " + packet.type + String.join(" ", packet.users)); + Chat.sendCommand("/p " + packet.type.toString().toLowerCase() + " " + String.join(" ", packet.users)); } else { Chat.sendPrivateMessageToSelfImportantInfo("Blocked a Party Command from the Server: " + packet.type + " : " + String.join(" ", packet.users)); |