package mhfc.net.client.render.projectile; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mhfc.net.common.entity.projectile.EntityBreathe; import mhfc.net.common.util.lib.MHFCReference; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; @SideOnly(Side.CLIENT) public class RenderBreathe extends Render { private static final ResourceLocation set_TEXTURES = new ResourceLocation(MHFCReference.projectile_breathe_tex); /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(EntityBreathe projectile, double x, double y, double z, float par8, float par9) { GL11.glPushMatrix(); this.bindEntityTexture(projectile); GL11.glTranslatef((float) x, (float) y, (float) z); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F, 0.5F); Tessellator tessellator = Tessellator.instance; float minU = 0; float maxU = 1; float minV = 0; float maxV = 1; float f7 = 1.0F; float f8 = 0.5F; float f9 = 0.25F; GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); tessellator.addVertexWithUV(0.0F - f8, 0.0F - f9, 0.0D, minU, maxV); tessellator.addVertexWithUV(f7 - f8, 0.0F - f9, 0.0D, maxU, maxV); tessellator.addVertexWithUV(f7 - f8, 1.0F - f9, 0.0D, maxU, minV); tessellator.addVertexWithUV(0.0F - f8, 1.0F - f9, 0.0D, minU, minV); tessellator.draw(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityBreathe p_110775_1_) { return set_TEXTURES; } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(Entity p_110775_1_) { return this.getEntityTexture((EntityBreathe) p_110775_1_); } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender( Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { this.doRender((EntityBreathe) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); } }