aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/djtheredstoner/perspectivemod/asm/hooks/EntityRendererHook.java
blob: 3ee3c9e4b15fdff308194719023336169e080672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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();
    }

}