aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-05-25 17:54:35 -0500
committeringlettronald <inglettronald@gmail.com>2023-05-25 17:54:35 -0500
commite645175075b28d13266650ec00f6d5b7927133bf (patch)
tree145701d4173ac2658f7f8fa870320f23e9de635f /src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
parent1cc4b53862eb60e892b8c5cf1190b8cd6a62d32b (diff)
downloadDulkirMod-e645175075b28d13266650ec00f6d5b7927133bf.tar.gz
DulkirMod-e645175075b28d13266650ec00f6d5b7927133bf.tar.bz2
DulkirMod-e645175075b28d13266650ec00f6d5b7927133bf.zip
better interpolation
Diffstat (limited to 'src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt')
-rw-r--r--src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
index f49ed2c..229b380 100644
--- a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
+++ b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
@@ -1,6 +1,7 @@
package dulkirmod.utils
import dulkirmod.DulkirMod.Companion.mc
+import dulkirmod.mixins.AccessorRenderManager
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.renderer.GlStateManager.disableTexture2D
import net.minecraft.client.renderer.GlStateManager.enableTexture2D
@@ -180,5 +181,21 @@ class WorldRenderUtils {
fun grabPartialTicks(event: RenderWorldLastEvent) {
this.partialTicks = event.partialTicks
}
+
+ fun getRenderX() : Double {
+ return (mc.renderManager as AccessorRenderManager).renderX
+ }
+
+ fun getRenderY() : Double {
+ return (mc.renderManager as AccessorRenderManager).renderY
+ }
+
+ fun getRenderZ() : Double {
+ return (mc.renderManager as AccessorRenderManager).renderZ
+ }
+
+ fun fixRenderPos(x: Double, y: Double, z: Double) : Array<Double> {
+ return arrayOf(x + getRenderX(), y + getRenderY(), z + getRenderZ())
+ }
}
} \ No newline at end of file