49 lines
1.3 KiB
Java
Executable file
49 lines
1.3 KiB
Java
Executable file
package client.renderer.entity;
|
|
|
|
import org.lwjgl.opengl.GL46;
|
|
|
|
import client.renderer.model.ModelBat;
|
|
import common.entity.animal.EntityBat;
|
|
import common.util.ExtMath;
|
|
|
|
|
|
public class RenderBat extends RenderLiving<EntityBat>
|
|
{
|
|
private static final String batTextures = "textures/creature/bat.png";
|
|
|
|
public RenderBat(RenderManager renderManagerIn)
|
|
{
|
|
super(renderManagerIn, new ModelBat());
|
|
}
|
|
|
|
/**
|
|
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
|
*/
|
|
protected String getEntityTexture(EntityBat entity)
|
|
{
|
|
return batTextures;
|
|
}
|
|
|
|
/**
|
|
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
|
|
* entityLiving, partialTickTime
|
|
*/
|
|
protected void preRenderCallback(EntityBat entitylivingbaseIn, float partialTickTime)
|
|
{
|
|
GL46.glScalef(0.35F, 0.35F, 0.35F);
|
|
}
|
|
|
|
protected void rotateCorpse(EntityBat bat, float p_77043_2_, float p_77043_3_, float partialTicks)
|
|
{
|
|
if (!bat.getIsBatHanging())
|
|
{
|
|
GL46.glTranslatef(0.0F, ExtMath.cos(p_77043_2_ * 0.3F) * 0.1F, 0.0F);
|
|
}
|
|
else
|
|
{
|
|
GL46.glTranslatef(0.0F, -0.1F, 0.0F);
|
|
}
|
|
|
|
super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks);
|
|
}
|
|
}
|