Guest User

Render

a guest
Dec 11th, 2014
176
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ruirui.minecraft.livelyanimals;
  2.  
  3. import net.minecraft.client.model.ModelBase;
  4. import net.minecraft.client.renderer.entity.RenderLiving;
  5. import net.minecraft.entity.Entity;
  6. import net.minecraft.entity.EntityLivingBase;
  7. import net.minecraft.entity.passive.EntityPig;
  8. import net.minecraft.util.ResourceLocation;
  9.  
  10. public class LARenderPig extends RenderLiving
  11. {
  12. private static final ResourceLocation saddledPigTextures = new ResourceLocation(LivelyAnimals.AID, "textures/animals/LAPig.png");
  13. private static final ResourceLocation pigTextures = new ResourceLocation(LivelyAnimals.AID, "textures/animals/LAPig.png");
  14. private static final String __OBFID = "CL_00001019";
  15.  
  16. public LARenderPig(ModelBase p_i1265_1_, ModelBase p_i1265_2_, float p_i1265_3_)
  17. {
  18. super(p_i1265_1_, p_i1265_3_);
  19. this.setRenderPassModel(p_i1265_2_);
  20. }
  21.  
  22. /**
  23. * Queries whether should render the specified pass or not.
  24. */
  25. protected int shouldRenderPass(EntityPig p_77032_1_, int p_77032_2_, float p_77032_3_)
  26. {
  27. if (p_77032_2_ == 0 && p_77032_1_.getSaddled())
  28. {
  29. this.bindTexture(saddledPigTextures);
  30. return 1;
  31. }
  32. else
  33. {
  34. return -1;
  35. }
  36. }
  37.  
  38. /**
  39. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  40. */
  41. protected ResourceLocation getEntityTexture(EntityPig p_110775_1_)
  42. {
  43. return pigTextures;
  44. }
  45.  
  46. /**
  47. * Queries whether should render the specified pass or not.
  48. */
  49. protected int shouldRenderPass(EntityLivingBase p_77032_1_, int p_77032_2_, float p_77032_3_)
  50. {
  51. return this.shouldRenderPass((EntityPig)p_77032_1_, p_77032_2_, p_77032_3_);
  52. }
  53.  
  54. /**
  55. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  56. */
  57. protected ResourceLocation getEntityTexture(Entity p_110775_1_)
  58. {
  59. return this.getEntityTexture((EntityPig)p_110775_1_);
  60. }
  61. }
RAW Paste Data