aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-04-28 05:12:26 -0500
committeringlettronald <inglettronald@gmail.com>2023-04-28 05:12:26 -0500
commit71ee4357b59cf30a85acce0e725078b98f3bf55d (patch)
treeac9f3561f4afd6b89e91577606d6d2d1a1b1ff50 /src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt
parent650acb70a72c6c2195f4faa8d10529bb808800bd (diff)
downloadDulkirMod-71ee4357b59cf30a85acce0e725078b98f3bf55d.tar.gz
DulkirMod-71ee4357b59cf30a85acce0e725078b98f3bf55d.tar.bz2
DulkirMod-71ee4357b59cf30a85acce0e725078b98f3bf55d.zip
removed conflicting file structure name
Diffstat (limited to 'src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt')
-rw-r--r--src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt b/src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt
new file mode 100644
index 0000000..abed145
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/overlays/YawDisplayHud.kt
@@ -0,0 +1,29 @@
+package dulkirmod.overlays
+
+import cc.polyfrost.oneconfig.hud.TextHud
+import dulkirmod.DulkirMod.Companion.mc
+import dulkirmod.config.DulkirConfig
+import dulkirmod.utils.TabListUtils
+import dulkirmod.utils.Utils
+
+class YawDisplayHud : TextHud(false) {
+ override fun getLines(lines: MutableList<String>?, example: Boolean) {
+ if (!Utils.isInSkyblock()) return
+ if (TabListUtils.area != "Garden") return
+ val pitch = mc.thePlayer.rotationPitch
+ var yaw = mc.thePlayer.rotationYaw % 360f
+
+ if (yaw < -180.0f) {
+ yaw += 360.0f;
+ } else if (yaw > 180.0f) {
+ yaw -= 360.0f;
+ }
+ if (DulkirConfig.yaw3Decimals) {
+ lines?.add(0, String.format("Yaw: %.3f", yaw))
+ } else {
+ lines?.add(0, String.format("Yaw: %.2f", yaw))
+ }
+ if (DulkirConfig.showPitch)
+ lines?.add(1, String.format("Pitch: %.2f", pitch))
+ }
+} \ No newline at end of file