mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 21:06:16 +00:00
feat: pass UUID placeholder to CustomChat
This commit is contained in:
parent
c61773fb73
commit
fc4e2d2ccc
2 changed files with 2 additions and 6 deletions
|
|
@ -4,8 +4,6 @@ import com.google.common.hash.Hashing;
|
|||
import com.google.gson.JsonElement;
|
||||
import land.chipmunk.chipmunkmod.ChipmunkMod;
|
||||
|
||||
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
|
|
@ -13,13 +11,10 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
|||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CustomChat {
|
||||
private final MinecraftClient client;
|
||||
|
|
@ -127,6 +122,7 @@ public class CustomChat {
|
|||
// .replace("\"PREFIX\"", prefix)
|
||||
// .replace("\"DISPLAYNAME\"", displayName)
|
||||
.replace("USERNAME", username)
|
||||
.replace("UUID", player.getUuidAsString())
|
||||
.replace("HASH", hash)
|
||||
.replace("{\"text\":\"MESSAGE\"}", messageWithColor)
|
||||
.replace("\"extra\":[\"MESSAGE\"],\"color\":", "\"extra\":[" + messageWithColor + "],\"color\":")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
"translate": "chat.type.text",
|
||||
"with": [
|
||||
{
|
||||
"selector": "USERNAME"
|
||||
"selector": "UUID"
|
||||
},
|
||||
{
|
||||
"text": "MESSAGE"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue