From 8db3669d5ac49b7ee939351e30f8c0d28e20e986 Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Thu, 7 Dec 2023 21:31:56 +0100 Subject: bug fixes --- common/src/main/java/de/hype/bbsentials/common/chat/Message.java | 6 ++---- .../hype/bbsentials/common/communication/BBsentialConnection.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'common') 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)); -- cgit