aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorHacktheTime <l4bg0jb7@duck.com>2023-12-07 21:31:56 +0100
committerHacktheTime <l4bg0jb7@duck.com>2023-12-07 21:31:56 +0100
commit8db3669d5ac49b7ee939351e30f8c0d28e20e986 (patch)
treef8057af1cccfd3ed74ad6c741a6f6f7cc708db16 /common
parent291f3540db145807dbf506aa98374bfd37d1a426 (diff)
downloadBBsentials-8db3669d5ac49b7ee939351e30f8c0d28e20e986.tar.gz
BBsentials-8db3669d5ac49b7ee939351e30f8c0d28e20e986.tar.bz2
BBsentials-8db3669d5ac49b7ee939351e30f8c0d28e20e986.zip
bug fixes
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/de/hype/bbsentials/common/chat/Message.java6
-rw-r--r--common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java2
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));