diff options
Diffstat (limited to 'src/main/kotlin/dulkirmod/Huds/YawDisplayHud.kt')
-rw-r--r-- | src/main/kotlin/dulkirmod/Huds/YawDisplayHud.kt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/Huds/YawDisplayHud.kt b/src/main/kotlin/dulkirmod/Huds/YawDisplayHud.kt new file mode 100644 index 0000000..610ee08 --- /dev/null +++ b/src/main/kotlin/dulkirmod/Huds/YawDisplayHud.kt @@ -0,0 +1,29 @@ +package dulkirmod.Huds + +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(true) { + 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 |