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) {