|
2 | 2 |
|
3 | 3 | import java.util.HashSet; |
4 | 4 | import java.util.UUID; |
| 5 | +import com.google.gson.Gson; |
| 6 | +import com.mojang.serialization.JsonOps; |
5 | 7 | import net.evmodder.EvLib.util.Command; |
6 | 8 | import net.evmodder.EvLib.util.FileIO; |
7 | 9 | import net.evmodder.EvLib.util.PacketHelper; |
|
14 | 16 | import net.minecraft.client.MinecraftClient; |
15 | 17 | import net.minecraft.client.network.PlayerListEntry; |
16 | 18 | import net.minecraft.text.Text; |
| 19 | +import net.minecraft.text.TextCodecs; |
17 | 20 |
|
18 | 21 | public class GameMessageListener{ |
19 | 22 | private void saveMyIgnores(UUID myUUID, UUID ignoredUUID, boolean ignored){ |
@@ -64,9 +67,11 @@ public GameMessageListener(RemoteServerSender rms, EpearlLookupFabric epl, Whisp |
64 | 67 |
|
65 | 68 | ClientReceiveMessageEvents.GAME.register((msg, overlay) -> { |
66 | 69 | if(overlay) return; |
| 70 | + final String json = new Gson().toJson(TextCodecs.CODEC.encodeStart(JsonOps.INSTANCE, msg).getOrThrow()); |
| 71 | + if(json.contains("EvModder")) Main.LOGGER.info("GameMsgListener: EvModder mentioned (json):\n"+json); |
67 | 72 | final String literal = msg.getString(); |
68 | 73 | if(literal == null) return; |
69 | | -// Main.LOGGER.info("GameMsgListener: received msg: "+literal); |
| 74 | + if(literal.contains("EvModder")) Main.LOGGER.info("GameMsgListener: EvModder mentioned (literal):\n"+literal); |
70 | 75 |
|
71 | 76 | if(literal.matches("^\\w+ whispers: .*")){// TODO: per-server format support |
72 | 77 | // Main.LOGGER.info("GameMsgListener: whisper detected"); |
|
0 commit comments