diff --git a/src/main/java/me/chayapak1/chomens_bot/chatParsers/CreayunChatParser.java b/src/main/java/me/chayapak1/chomens_bot/chatParsers/CreayunChatParser.java index 1b5921b..2d811d5 100644 --- a/src/main/java/me/chayapak1/chomens_bot/chatParsers/CreayunChatParser.java +++ b/src/main/java/me/chayapak1/chomens_bot/chatParsers/CreayunChatParser.java @@ -1,5 +1,6 @@ package me.chayapak1.chomens_bot.chatParsers; +import me.chayapak1.chomens_bot.util.UUIDUtilities; import org.geysermc.mcprotocollib.auth.GameProfile; import org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode; import me.chayapak1.chomens_bot.Bot; @@ -38,7 +39,7 @@ public class CreayunChatParser implements ChatParser { final String contents = matcher.group(2); PlayerEntry sender = bot.players.getEntry(displayName); - if (sender == null) sender = new PlayerEntry(new GameProfile(new UUID(0L, 0L), displayName), GameMode.SURVIVAL, 0, Component.text(displayName), 0L, null, new byte[0], true); + if (sender == null) sender = new PlayerEntry(new GameProfile(UUIDUtilities.getOfflineUUID(displayName), displayName), GameMode.SURVIVAL, 0, Component.text(displayName), 0L, null, new byte[0], true); return new PlayerMessage(sender, Component.text(displayName), Component.text(contents)); } diff --git a/src/main/java/me/chayapak1/chomens_bot/chatParsers/KaboomChatParser.java b/src/main/java/me/chayapak1/chomens_bot/chatParsers/KaboomChatParser.java index 20753b7..58401fe 100644 --- a/src/main/java/me/chayapak1/chomens_bot/chatParsers/KaboomChatParser.java +++ b/src/main/java/me/chayapak1/chomens_bot/chatParsers/KaboomChatParser.java @@ -1,5 +1,7 @@ package me.chayapak1.chomens_bot.chatParsers; +import me.chayapak1.chomens_bot.util.ComponentUtilities; +import me.chayapak1.chomens_bot.util.UUIDUtilities; import org.geysermc.mcprotocollib.auth.GameProfile; import org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode; import me.chayapak1.chomens_bot.Bot; @@ -43,9 +45,12 @@ public class KaboomChatParser implements ChatParser { return null; } +// final String stringifiedDisplayName = ComponentUtilities.stringify(displayName); + PlayerEntry sender = bot.players.getEntry(Component.empty().append(prefix).append(displayName)); if (sender == null) sender = bot.players.getEntry(prefix.append(displayName)); // old - if (sender == null) sender = new PlayerEntry(new GameProfile(new UUID(0L, 0L), null), GameMode.SURVIVAL, 0, displayName, 0L, null, new byte[0], true); // new and currently using +// if (sender == null) sender = new PlayerEntry(new GameProfile(UUIDUtilities.getOfflineUUID(stringifiedDisplayName), stringifiedDisplayName), GameMode.SURVIVAL, 0, displayName, 0L, null, new byte[0], true); // new and currently using + if (sender == null) return null; return new PlayerMessage(sender, displayName, contents); }