aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/features/debug
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-07-27 05:07:58 +0200
committerLinnea Gräf <nea@nea.moe>2024-07-27 05:07:58 +0200
commit60994a08677d864f79de58d8912b02d2d7077289 (patch)
tree70850c6acb5d6fa58d8df9cc08e06a7d92606f2a /src/main/kotlin/moe/nea/firmament/features/debug
parent564f81e1896ea36b9ad165f29f49ce990912c388 (diff)
downloadFirmament-60994a08677d864f79de58d8912b02d2d7077289.tar.gz
Firmament-60994a08677d864f79de58d8912b02d2d7077289.tar.bz2
Firmament-60994a08677d864f79de58d8912b02d2d7077289.zip
Add some carnival features
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features/debug')
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt18
-rw-r--r--src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt b/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
new file mode 100644
index 0000000..72a641a
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firmament/features/debug/DebugLogger.kt
@@ -0,0 +1,18 @@
+/*
+ * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+package moe.nea.firmament.features.debug
+
+import net.minecraft.text.Text
+import moe.nea.firmament.util.MC
+
+class DebugLogger(val tag: String) {
+ fun isEnabled() = DeveloperFeatures.isEnabled // TODO: allow filtering by tag
+ fun log(text: () -> String) {
+ if (!isEnabled()) return
+ MC.sendChat(Text.literal(text()))
+ }
+}
diff --git a/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt b/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt
index ec565aa..95ed72d 100644
--- a/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt
+++ b/src/main/kotlin/moe/nea/firmament/features/debug/PowerUserTools.kt
@@ -88,6 +88,7 @@ object PowerUserTools : FirmamentFeature {
fun showEntity(target: Entity) {
MC.sendChat(Text.translatable("firmament.poweruser.entity.type", target.type))
MC.sendChat(Text.translatable("firmament.poweruser.entity.name", target.name))
+ MC.sendChat(Text.stringifiedTranslatable("firmament.poweruser.entity.position", target.pos))
if (target is LivingEntity) {
MC.sendChat(Text.translatable("firmament.poweruser.entity.armor"))
for (armorItem in target.armorItems) {