aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java')
-rw-r--r--src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java b/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
new file mode 100644
index 0000000..a6ea788
--- /dev/null
+++ b/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
@@ -0,0 +1,32 @@
+package me.djtheredstoner.perspectivemod.asm.hooks;
+
+import me.djtheredstoner.perspectivemod.PerspectiveMod;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+
+public class EntityRendererHook {
+
+ public static float rotationYawHook(Entity entity) {
+ return PerspectiveMod.instance.perspectiveToggled ? PerspectiveMod.instance.cameraYaw : entity.rotationYaw;
+ }
+
+ public static float prevRotationYawHook(Entity entity) {
+ return PerspectiveMod.instance.perspectiveToggled ? PerspectiveMod.instance.cameraYaw : entity.prevRotationYaw;
+ }
+
+ public static float rotationPitchHook(Entity entity) {
+ return PerspectiveMod.instance.perspectiveToggled ? PerspectiveMod.instance.cameraPitch : entity.rotationPitch;
+ }
+
+ public static float prevRotationPitchHook(Entity entity) {
+ return PerspectiveMod.instance.perspectiveToggled ? PerspectiveMod.instance.cameraPitch : entity.prevRotationPitch;
+ }
+
+ public static boolean mouseHook(Minecraft minecraft) {
+ return PerspectiveMod.instance == null ? minecraft.inGameHasFocus : PerspectiveMod.instance.overrideMouse();
+ }
+
+ public static double distanceHook(double value) {
+ return value;
+ }
+}