Advertisement
Guest User

Untitled

a guest
May 21st, 2014
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. package com.kazeyometest.tuto.client;
  2.  
  3. import org.lwjgl.opengl.GL11;
  4. import org.lwjgl.opengl.GL12;
  5.  
  6. import com.kazeyometest.tuto.common.EntitySortilege;
  7. import com.kazeyometest.tuto.common.modTutoriel;
  8.  
  9. import net.minecraft.client.renderer.Tessellator;
  10. import net.minecraft.client.renderer.entity.RenderFireball;
  11. import net.minecraft.client.renderer.texture.TextureMap;
  12. import net.minecraft.entity.Entity;
  13. import net.minecraft.entity.projectile.EntityFireball;
  14. import net.minecraft.init.Items;
  15. import net.minecraft.util.IIcon;
  16. import net.minecraft.util.ResourceLocation;
  17.  
  18. public class RenderSortilege extends RenderFireball {
  19.  
  20. private float field_77002_a;
  21. public final ResourceLocation texture = new ResourceLocation(modTutoriel.MODID, "textures/entity/sortilege.png");
  22.  
  23. public RenderSortilege(float par1){
  24. super(par1);
  25. }
  26.  
  27. public void doRender(EntitySortilege par1EntityFireball, double par2, double par4, double par6, float par8, float par9) {
  28. GL11.glPushMatrix();
  29. this.bindEntityTexture(par1EntityFireball);
  30. GL11.glTranslatef((float)par2, (float)par4, (float)par6);
  31. GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  32. float f2 = this.field_77002_a;
  33. GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
  34. IIcon iicon = Items.fire_charge.getIconFromDamage(0);
  35. Tessellator tessellator = Tessellator.instance;
  36. float f3 = iicon.getMinU();
  37. float f4 = iicon.getMaxU();
  38. float f5 = iicon.getMinV();
  39. float f6 = iicon.getMaxV();
  40. float f7 = 1.0F;
  41. float f8 = 0.5F;
  42. float f9 = 0.25F;
  43. GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
  44. GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
  45. tessellator.startDrawingQuads();
  46. tessellator.setNormal(0.0F, 1.0F, 0.0F);
  47. tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
  48. tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
  49. tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
  50. tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
  51. tessellator.draw();
  52. GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  53. GL11.glPopMatrix();
  54. }
  55.  
  56. protected ResourceLocation getEntityTexture(EntityFireball par1EntityFireball) {
  57. return texture;
  58. }
  59.  
  60. public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
  61. this.doRender((EntitySortilege)par1Entity, par2, par4, par6, par8, par9);
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement