Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. package kristenores.mod.entity.wither.UselessWither;
  2.  
  3. import javax.annotation.Nonnull;
  4.  
  5. import kristenores.mod.entity.spider.CopperSpider.EntityCopperSpider;
  6. import kristenores.mod.entity.squid.kraken.FlyingKraken.EntityFlyingKraken;
  7. import kristenores.mod.entity.squid.kraken.FlyingKraken.RenderFlyingKraken;
  8. import net.minecraft.client.model.ModelWither;
  9. import net.minecraft.client.renderer.GlStateManager;
  10. import net.minecraft.client.renderer.entity.Render;
  11. import net.minecraft.client.renderer.entity.RenderLiving;
  12. import net.minecraft.client.renderer.entity.RenderManager;
  13. import net.minecraft.client.renderer.entity.layers.LayerWitherAura;
  14. import net.minecraft.entity.boss.EntityWither;
  15. import net.minecraft.util.ResourceLocation;
  16. import net.minecraftforge.fml.client.registry.IRenderFactory;
  17. import net.minecraftforge.fml.relauncher.Side;
  18. import net.minecraftforge.fml.relauncher.SideOnly;
  19.  
  20. @SideOnly(Side.CLIENT)
  21. public class RenderUselessWither extends RenderLiving<EntityUselessWither>
  22. {
  23. private static final ResourceLocation INVULNERABLE_WITHER_TEXTURES = new ResourceLocation("textures/entity/wither/wither_invulnerable.png");
  24. private static final ResourceLocation WITHER_TEXTURES = new ResourceLocation("textures/entity/wither/wither.png");
  25.  
  26. public RenderUselessWither(RenderManager renderManagerIn)
  27. {
  28. super(renderManagerIn, new ModelWither(0.0F), 1.0F);
  29. }
  30.  
  31. /**
  32. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
  33. */
  34. protected ResourceLocation getEntityTexture(EntityWither entity)
  35. {
  36. int i = entity.getInvulTime();
  37. return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_WITHER_TEXTURES : WITHER_TEXTURES;
  38. }
  39.  
  40. /**
  41. * Allows the render to do state modifications necessary before the model is rendered.
  42. */
  43. protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime)
  44. {
  45. float f = 2.0F;
  46. int i = entitylivingbaseIn.getInvulTime();
  47.  
  48. if (i > 0)
  49. {
  50. f -= ((float)i - partialTickTime) / 220.0F * 0.5F;
  51. }
  52.  
  53. GlStateManager.scale(f, f, f);
  54. }
  55.  
  56. @Override
  57. @Nonnull
  58. protected ResourceLocation getEntityTexture(@Nonnull EntityUselessWither entity) {
  59. return WITHER_TEXTURES;
  60. }
  61.  
  62. public static class Factory implements IRenderFactory<EntityUselessWither> {
  63.  
  64. @Override
  65. public Render<? super EntityUselessWither> createRenderFor(RenderManager manager) {
  66. return new RenderUselessWither(manager);
  67. }
  68.  
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement