Advertisement
Guest User

RenderDiamondDragon

a guest
Jul 30th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. package main.com.blueeyes.dutchangeldragons.entity.render;
  2.  
  3. import main.com.blueeyes.dutchangeldragons.entity.EntityBirchDragon;
  4. import main.com.blueeyes.dutchangeldragons.entity.model.ModelTinyDragon;
  5. import net.minecraft.client.model.ModelBase;
  6. import net.minecraft.client.renderer.entity.RenderLiving;
  7. import net.minecraft.entity.Entity;
  8. import net.minecraft.entity.EntityLivingBase;
  9. import net.minecraft.util.ResourceLocation;
  10.  
  11. import org.lwjgl.opengl.GL11;
  12.  
  13. public class RenderDiamondDragon extends RenderLiving{
  14.  
  15. private static final ResourceLocation texture = new ResourceLocation("dutchangeldragons:textures/models/diamond.png");
  16. private ModelBase scaleAmount;
  17. public RenderDiamondDragon() {
  18. super(new ModelTinyDragon(), 0.55f);
  19. }
  20.  
  21.  
  22. public RenderDiamondDragon(ModelBase p_i1267_1_, ModelBase p_i1267_2_, float p_i1267_3_)
  23. {
  24. super(p_i1267_1_, p_i1267_3_);
  25. this.scaleAmount = p_i1267_2_;
  26. }
  27.  
  28.  
  29.  
  30.  
  31. protected int shouldRenderPass(EntityBirchDragon p_77032_1_, int p_77032_2_, float p_77032_3_)
  32. {
  33. if (p_77032_1_.isInvisible())
  34. {
  35. return 0;
  36. }
  37. else if (p_77032_2_ == 0)
  38. {
  39. this.setRenderPassModel(this.scaleAmount);
  40. GL11.glEnable(GL11.GL_NORMALIZE);
  41. GL11.glEnable(GL11.GL_BLEND);
  42. GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  43. return 1;
  44. }
  45. else
  46. {
  47. if (p_77032_2_ == 1)
  48. {
  49. GL11.glDisable(GL11.GL_BLEND);
  50. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  51. }
  52.  
  53. return -1;
  54. }
  55. }
  56.  
  57.  
  58.  
  59.  
  60. @Override
  61. protected ResourceLocation getEntityTexture(Entity entity) {
  62. return texture;
  63. }
  64.  
  65. protected void preRenderCallback(EntityLivingBase p_77041_1_, float p_77041_2_)
  66. {
  67. float scale = 1.0f;
  68. GL11.glScalef(scale, scale, scale);
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement