aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
diff options
context:
space:
mode:
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