aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/lorenz/mod/mixinhooks
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/lorenz/mod/mixinhooks')
-rw-r--r--src/main/java/at/lorenz/mod/mixinhooks/RenderManagerHook.kt25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/at/lorenz/mod/mixinhooks/RenderManagerHook.kt b/src/main/java/at/lorenz/mod/mixinhooks/RenderManagerHook.kt
new file mode 100644
index 000000000..69242d651
--- /dev/null
+++ b/src/main/java/at/lorenz/mod/mixinhooks/RenderManagerHook.kt
@@ -0,0 +1,25 @@
+package at.lorenz.mod.mixinhooks
+
+import at.lorenz.mod.events.CheckRenderEntityEvent
+import net.minecraft.client.renderer.culling.ICamera
+import net.minecraft.entity.Entity
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
+
+fun shouldRender(
+ entityIn: Entity,
+ camera: ICamera,
+ camX: Double,
+ camY: Double,
+ camZ: Double,
+ cir: CallbackInfoReturnable<Boolean>
+) {
+ if (
+ CheckRenderEntityEvent(
+ entityIn,
+ camera,
+ camX,
+ camY,
+ camZ
+ ).postAndCatch()
+ ) cir.returnValue = false
+} \ No newline at end of file