summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java
blob: 9fd3c6277fe3281c0943be85f088579dbfbe3d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package darkknight.jewelrycraft.entities.renders;

import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;

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);
    }
}