Guest User

RenderWandBolt

a guest
Nov 1st, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. package wop;
  2.  
  3. import javax.swing.Icon;
  4.  
  5. import net.minecraft.client.renderer.Tessellator;
  6. import net.minecraft.client.renderer.entity.Render;
  7. import net.minecraft.client.renderer.texture.TextureMap;
  8. import net.minecraft.entity.Entity;
  9. import net.minecraft.entity.projectile.EntityPotion;
  10. import net.minecraft.item.Item;
  11. import net.minecraft.item.ItemPotion;
  12. import net.minecraft.potion.PotionHelper;
  13. import net.minecraft.util.ResourceLocation;
  14.  
  15. import org.lwjgl.opengl.GL11;
  16. import org.lwjgl.opengl.GL12;
  17.  
  18. import wop.items.EntityWandBolt;
  19. import wop.items.ModItems;
  20. import wop.lib.Constants;
  21. import cpw.mods.fml.relauncher.Side;
  22. import cpw.mods.fml.relauncher.SideOnly;
  23.  
  24. @SideOnly(Side.CLIENT)
  25. public class RenderWandBolt extends Render
  26. {
  27. private Item field_94151_a;
  28. private int field_94150_f;
  29.  
  30. public RenderWandBolt(Item par1Item, int par2)
  31. {
  32. this.field_94151_a = par1Item;
  33. this.field_94150_f = par2;
  34. }
  35.  
  36. public RenderWandBolt(Item par1Item)
  37. {
  38. this(par1Item, 0);
  39. }
  40.  
  41. //ResourceLocations are typically static and final, but that is not an absolute requirement
  42. private static final ResourceLocation texture = new ResourceLocation(Constants.MODID, ":textures/entity/magic_Pro.png");
  43.  
  44.  
  45. @Override
  46. protected ResourceLocation getEntityTexture(Entity entity) {
  47. //this method should return your texture, which may be different based
  48. //on certain characteristics of your custom entity; if that is the case,
  49. //you may want to make a second method that takes your class:
  50. return texture;
  51. }
  52.  
  53. public void doRender(Entity par1Entity, double p2, double p3, double p4, float par8, float par9)
  54. {
  55.  
  56. GL11.glPushMatrix();
  57. GL11.glTranslatef((float)p2, (float)p3, (float)p4);
  58. GL11.glEnable(GL12.GL_RESCALE_NORMAL);
  59. GL11.glScalef(0.5F, 0.5F, 0.5F);
  60. bindEntityTexture(par1Entity);
  61. Tessellator tessellator = Tessellator.instance;
  62.  
  63. float f4 = 1.0F;
  64. float f5 = 0.5F;
  65. float f6 = 0.25F;
  66. GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
  67. GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
  68. tessellator.startDrawingQuads();
  69. tessellator.setNormal(0.0F, 1.0F, 0.0F);
  70. tessellator.addVertex((double)(0.0F - f5), (double)(0.0F - f6), 0.0D);
  71. tessellator.addVertex((double)(f4 - f5), (double)(0.0F - f6), 0.0D);
  72. tessellator.addVertex((double)(f4 - f5), (double)(f4 - f6), 0.0D);
  73. tessellator.addVertex((double)(0.0F - f5), (double)(f4 - f6), 0.0D);
  74. tessellator.draw();
  75. GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  76. GL11.glPopMatrix();
  77. }
  78.  
  79.  
  80.  
  81. /**
  82. * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
  83. * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
  84. * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
  85. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
  86. */
  87.  
  88. // For Forge 804:
  89.  
  90.  
  91. // For Forge 871:
  92.  
  93.  
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment