Update client event hook

This commit is contained in:
DBotThePony 2024-08-23 20:12:37 +07:00
parent 302076b90b
commit b38d34860c
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.client
import net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent
import net.neoforged.neoforge.client.event.ClientTickEvent
import net.neoforged.neoforge.client.event.RenderFrameEvent
import org.lwjgl.glfw.GLFW
import ru.dbotthepony.mc.otm.core.util.IConditionalTickable
import ru.dbotthepony.mc.otm.core.util.ITickable
@ -48,12 +49,10 @@ enum class CursorType(val pointer: LongSupplier) {
}
}
fun onClientPostRender(event: RenderTickEvent) {
if (event.phase == TickEvent.Phase.END) {
if (MODIFIED_CURSOR_FRAMES-- <= 0 && MODIFIED_CURSOR) {
GLFW.glfwSetCursor(minecraft.window.window, ARROW_CURSOR)
MODIFIED_CURSOR = false
}
fun onClientPostRender(event: RenderFrameEvent.Post) {
if (MODIFIED_CURSOR_FRAMES-- <= 0 && MODIFIED_CURSOR) {
GLFW.glfwSetCursor(minecraft.window.window, ARROW_CURSOR)
MODIFIED_CURSOR = false
}
}