diff options
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/hud/SpeedOverlay.kt')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/hud/SpeedOverlay.kt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/hud/SpeedOverlay.kt b/src/main/kotlin/com/dulkirfabric/hud/SpeedOverlay.kt new file mode 100644 index 0000000..eaee06c --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/hud/SpeedOverlay.kt @@ -0,0 +1,23 @@ +package com.dulkirfabric.hud + +import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.HudRenderEvent +import com.dulkirfabric.util.TablistUtils +import meteordevelopment.orbit.EventHandler +import moe.nea.jarvis.api.Point +import net.minecraft.text.Text + +object SpeedOverlay { + private val speedHud = DulkirConfig.hudElement("SpeedHud", Text.literal("Speed"), 24 + 4, 11, Point(0.2, 0.2)) + + @EventHandler + fun onHudRender(event: HudRenderEvent) { + val context = event.context + val matrices = context.matrices + matrices.push() + speedHud.applyTransformations(matrices) + context.drawText(mc.textRenderer, Text.literal(TablistUtils.persistentInfo.speed),0, 1, -1, true) + matrices.pop() + } +}
\ No newline at end of file |