From 14fd220fbeb64e799ee29cf1c7fc88a77e5e9e6c Mon Sep 17 00:00:00 2001
From: ChomeNS <95471003+ChomeNS@users.noreply.github.com>
Date: Mon, 24 Apr 2023 14:28:01 +0700
Subject: [PATCH] actually fix the fix the first "fix" is just fix like just
fix,.., then the second one is the last commit, "fix chat (/say and /me) i
guess"
---
.idea/workspace.xml | 19 ++++++++-----------
.../chomens_bot/plugins/ChatPlugin.java | 9 +++++----
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index bde6e600..612e6510 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,9 +6,6 @@
-
-
-
@@ -101,13 +98,6 @@
1680245437032
-
- 1681547507213
-
-
-
- 1681547507213
- 1681547771112
@@ -444,7 +434,14 @@
1682317167721
-
+
+ 1682320575423
+
+
+
+ 1682320575423
+
+
diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
index 9172e703..878b2b23 100644
--- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
+++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java
@@ -130,17 +130,18 @@ public class ChatPlugin extends SessionAdapter {
}
public void packetReceived (ClientboundDisguisedChatPacket packet) {
- // totallynotskidded™ from chipmunkbot and modified a bit i guess
- // PlayerMessage parsedFromMessage = null;
+ // totallynotskidded™ from chipmunkbot and modified i guess
+
+ final int type = packet.getChatType();
// i think im missing other types
- if (packet.getChatType() == 1) { // type 1 is /me
+ if (type == 1 || type == 4) { // type 1 is /me, type 4 is /say
final Component name = packet.getName();
final Component content = packet.getMessage();
for (ChatParser parser : chatParsers) {
final Component component = Component.translatable(
- "chat.type.emote",
+ type == 1 ? "chat.type.emote" : "chat.type.announcement",
name,
content
);