aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/utils/TextUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils/TextUtils.kt')
-rw-r--r--src/main/kotlin/dulkirmod/utils/TextUtils.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/TextUtils.kt b/src/main/kotlin/dulkirmod/utils/TextUtils.kt
index 6da1dd8..54072bc 100644
--- a/src/main/kotlin/dulkirmod/utils/TextUtils.kt
+++ b/src/main/kotlin/dulkirmod/utils/TextUtils.kt
@@ -5,6 +5,8 @@ import net.minecraft.util.ChatComponentText
object TextUtils {
fun info(text: String, prefix: Boolean = true) {
+ if (DulkirMod.mc.thePlayer == null) return
+
val textPrefix = if (prefix) "${DulkirMod.CHAT_PREFIX} " else ""
DulkirMod.mc.thePlayer.addChatMessage(ChatComponentText("$textPrefix$text§r"))
}