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"
This commit is contained in:
Chayapak 2023-04-24 14:28:01 +07:00
parent a49b078a6f
commit 14fd220fbe
2 changed files with 13 additions and 15 deletions

View file

@ -6,9 +6,6 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="fix chat (/say and /me) i guess"> <list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="fix chat (/say and /me) i guess">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/ConsoleCommandContext.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/ConsoleCommandContext.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/command/PlayerCommandContext.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/TestCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/TestCommand.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ChatPlugin.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -101,13 +98,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680245437032</updated> <updated>1680245437032</updated>
</task> </task>
<task id="LOCAL-00061" summary="make self care use core if it can">
<created>1681547507213</created>
<option name="number" value="00061" />
<option name="presentableId" value="LOCAL-00061" />
<option name="project" value="LOCAL" />
<updated>1681547507213</updated>
</task>
<task id="LOCAL-00062" summary="remove the time from cb"> <task id="LOCAL-00062" summary="remove the time from cb">
<created>1681547771112</created> <created>1681547771112</created>
<option name="number" value="00062" /> <option name="number" value="00062" />
@ -444,7 +434,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1682317167721</updated> <updated>1682317167721</updated>
</task> </task>
<option name="localTasksCounter" value="110" /> <task id="LOCAL-00110" summary="fix chat (/say and /me) i guess">
<created>1682320575423</created>
<option name="number" value="00110" />
<option name="presentableId" value="LOCAL-00110" />
<option name="project" value="LOCAL" />
<updated>1682320575423</updated>
</task>
<option name="localTasksCounter" value="111" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">

View file

@ -130,17 +130,18 @@ public class ChatPlugin extends SessionAdapter {
} }
public void packetReceived (ClientboundDisguisedChatPacket packet) { public void packetReceived (ClientboundDisguisedChatPacket packet) {
// totallynotskidded from chipmunkbot and modified a bit i guess // totallynotskidded from chipmunkbot and modified i guess
// PlayerMessage parsedFromMessage = null;
final int type = packet.getChatType();
// i think im missing other types // 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 name = packet.getName();
final Component content = packet.getMessage(); final Component content = packet.getMessage();
for (ChatParser parser : chatParsers) { for (ChatParser parser : chatParsers) {
final Component component = Component.translatable( final Component component = Component.translatable(
"chat.type.emote", type == 1 ? "chat.type.emote" : "chat.type.announcement",
name, name,
content content
); );