From 8edc6cf395e935b8a83982ca4bf55c4119cc1ddc Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Fri, 5 May 2023 10:15:24 +0700 Subject: [PATCH] hopefully fix the custom chat issue fard fard --- .../land/chipmunk/chipmunkmod/modules/CustomChat.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java index e38b08c..1862d42 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java @@ -1,5 +1,6 @@ package land.chipmunk.chipmunkmod.modules; +import com.google.gson.JsonElement; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.data.MutablePlayerListEntry; import lombok.Getter; @@ -18,10 +19,15 @@ public class CustomChat { @Getter @Setter private boolean enabled = true; - @Getter @Setter private String format = ChipmunkMod.CONFIG.customChat.format.toString(); + @Getter @Setter private String format; public CustomChat (MinecraftClient client) { this.client = client; + + final JsonElement formatString = ChipmunkMod.CONFIG.customChat.format; + + if (formatString == null) format = "{\"translate\":\"chat.type.text\",\"with\":[\"USERNAME\",\"MESSAGE\"]}"; + else format = formatString.toString(); } public void chat (String message) {