aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
diff options
context:
space:
mode:
authorDJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com>2020-09-09 10:15:38 -0400
committerDJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com>2020-09-09 10:16:13 -0400
commitbed926539ae75971011a44a7022b215ab9ffcf29 (patch)
treea9610603db6f4df60a86f1fb81cf0ecc53b2b552 /src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
parent07c0bb61e381293fc85ecf9ad01ab727e00efb00 (diff)
downloadPerspectiveModv4-bed926539ae75971011a44a7022b215ab9ffcf29.tar.gz
PerspectiveModv4-bed926539ae75971011a44a7022b215ab9ffcf29.tar.bz2
PerspectiveModv4-bed926539ae75971011a44a7022b215ab9ffcf29.zip
Did someone say ASM Rewrite???!!!
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.java29
1 files changed, 29 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..3ee3c9e
--- /dev/null
+++ b/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
@@ -0,0 +1,29 @@
+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.perspectiveToggled ? PerspectiveMod.cameraYaw : entity.rotationYaw;
+ }
+
+ public static float prevRotationYawHook(Entity entity) {
+ return PerspectiveMod.perspectiveToggled ? PerspectiveMod.cameraYaw : entity.prevRotationYaw;
+ }
+
+ public static float rotationPitchHook(Entity entity) {
+ return PerspectiveMod.perspectiveToggled ? PerspectiveMod.cameraPitch : entity.rotationPitch;
+ }
+
+ public static float prevRotationPitchHook(Entity entity) {
+ return PerspectiveMod.perspectiveToggled ? PerspectiveMod.cameraPitch : entity.prevRotationPitch;
+ }
+
+ public static boolean mouseHook(Minecraft minecraft) {
+ return PerspectiveMod.overrideMouse();
+ }
+
+}