blob: cf2278a14be4ab64ab22c07f474280568d9b3927 (
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 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);
}
}
|