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.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
index 231ab3f..f49ed2c 100644
--- a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
+++ b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
@@ -9,6 +9,8 @@ import net.minecraft.client.renderer.WorldRenderer
import net.minecraft.client.renderer.entity.RenderManager
import net.minecraft.client.renderer.vertex.DefaultVertexFormats
import net.minecraft.util.Vec3
+import net.minecraftforge.client.event.RenderWorldLastEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import org.lwjgl.opengl.GL11
import java.awt.Color
@@ -20,6 +22,7 @@ class WorldRenderUtils {
private val tessellator: Tessellator = Tessellator.getInstance()
private val worldRenderer: WorldRenderer = tessellator.worldRenderer
private val renderManager: RenderManager = mc.renderManager
+ var partialTicks: Float = 0f
fun renderString(
location: Vec3,
text: String,
@@ -172,5 +175,10 @@ class WorldRenderUtils {
GlStateManager.popMatrix()
}
+
+ @SubscribeEvent
+ fun grabPartialTicks(event: RenderWorldLastEvent) {
+ this.partialTicks = event.partialTicks
+ }
}
} \ No newline at end of file