summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java
blob: 8012d84fbb01c932781183bab01249a7d91ba0d9 (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
package darkknight.jewelrycraft.entities.renders;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.Loader;

public class RenderHelper
{
    public static void rotateIfSneaking(EntityPlayer player)
    {
        if (player.isSneaking()) applySneakingRotation();
    }
    
    public static void applySneakingRotation()
    {
        GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
    }
    
    public static void translateToHeadLevel(EntityPlayer player)
    {
        GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
    }
}