Advertisement
Guest User

Untitled

a guest
Dec 10th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. package DSFoFG.entities;
  2.  
  3. import net.minecraft.client.renderer.Tessellator;
  4. import net.minecraft.client.renderer.entity.Render;
  5. import net.minecraft.entity.Entity;
  6. import net.minecraft.entity.projectile.EntityArrow;
  7. import net.minecraft.util.MathHelper;
  8. import net.minecraft.util.ResourceLocation;
  9.  
  10. import org.lwjgl.opengl.GL11;
  11. import org.lwjgl.opengl.GL12;
  12.  
  13. import cpw.mods.fml.relauncher.Side;
  14. import cpw.mods.fml.relauncher.SideOnly;
  15.  
  16. @SideOnly(Side.CLIENT)
  17. public class renderPowerPack extends Render
  18. {
  19. private static final ResourceLocation powerPack = new ResourceLocation("dsfofg:textures/entity/powerPack.png");
  20. private static final String __OBFID = "CL_00000978";
  21.  
  22. /**
  23. * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
  24. * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
  25. * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
  26. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
  27. */
  28. public void doRender(powerPack p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
  29. {
  30. this.bindEntityTexture(p_76986_1_);
  31. GL11.glPushMatrix();
  32. GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
  33. GL11.glRotatef(p_76986_1_.prevRotationYaw + (p_76986_1_.rotationYaw - p_76986_1_.prevRotationYaw) * p_76986_9_ - 90.0F, 0.0F, 1.0F, 0.0F);
  34. GL11.glRotatef(p_76986_1_.prevRotationPitch + (p_76986_1_.rotationPitch - p_76986_1_.prevRotationPitch) * p_76986_9_, 0.0F, 0.0F, 1.0F);
  35. Tessellator tessellator = Tessellator.instance;
  36. byte b0 = 0;
  37. float f2 = 0.0F;
  38. float f3 = 0.5F;
  39. float f4 = (float)(0 + b0 * 10) / 32.0F;
  40. float f5 = (float)(5 + b0 * 10) / 32.0F;
  41. float f6 = 0.0F;
  42. float f7 = 0.15625F;
  43. float f8 = (float)(5 + b0 * 10) / 32.0F;
  44. float f9 = (float)(10 + b0 * 10) / 32.0F;
  45. float f10 = 0.05625F;
  46. GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  47. // float f11 = (float)p_76986_1_.arrowShake - p_76986_9_;
  48.  
  49. // if (f11 > 0.0F)
  50. {
  51. // float f12 = -MathHelper.sin(f11 * 3.0F) * f11;
  52. // GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F);
  53. }
  54.  
  55. GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
  56. GL11.glScalef(f10, f10, f10);
  57. GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
  58. GL11.glNormal3f(f10, 0.0F, 0.0F);
  59. tessellator.startDrawingQuads();
  60. tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
  61. tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
  62. tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
  63. tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
  64. tessellator.draw();
  65. GL11.glNormal3f(-f10, 0.0F, 0.0F);
  66. tessellator.startDrawingQuads();
  67. tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
  68. tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
  69. tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
  70. tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
  71. tessellator.draw();
  72.  
  73. for (int i = 0; i < 4; ++i)
  74. {
  75. GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
  76. GL11.glNormal3f(0.0F, 0.0F, f10);
  77. tessellator.startDrawingQuads();
  78. tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
  79. tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
  80. tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
  81. tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
  82. tessellator.draw();
  83. }
  84.  
  85. GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  86. GL11.glPopMatrix();
  87. }
  88.  
  89. /**
  90. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  91. */
  92. protected ResourceLocation getEntityTexture(powerPack p_110775_1_)
  93. {
  94. return powerPack;
  95. }
  96.  
  97. /**
  98. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  99. */
  100. protected ResourceLocation getEntityTexture(Entity p_110775_1_)
  101. {
  102. return this.getEntityTexture((powerPack)p_110775_1_);
  103. }
  104.  
  105. /**
  106. * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
  107. * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
  108. * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
  109. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
  110. */
  111. 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_)
  112. {
  113. this.doRender((powerPack)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
  114. }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement