Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kristenores.mod.entity.wither.UselessWither;
- import javax.annotation.Nonnull;
- import kristenores.mod.entity.spider.CopperSpider.EntityCopperSpider;
- import kristenores.mod.entity.squid.kraken.FlyingKraken.EntityFlyingKraken;
- import kristenores.mod.entity.squid.kraken.FlyingKraken.RenderFlyingKraken;
- import net.minecraft.client.model.ModelWither;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.entity.Render;
- import net.minecraft.client.renderer.entity.RenderLiving;
- import net.minecraft.client.renderer.entity.RenderManager;
- import net.minecraft.client.renderer.entity.layers.LayerWitherAura;
- import net.minecraft.entity.boss.EntityWither;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.fml.client.registry.IRenderFactory;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- @SideOnly(Side.CLIENT)
- public class RenderUselessWither extends RenderLiving<EntityUselessWither>
- {
- private static final ResourceLocation INVULNERABLE_WITHER_TEXTURES = new ResourceLocation("textures/entity/wither/wither_invulnerable.png");
- private static final ResourceLocation WITHER_TEXTURES = new ResourceLocation("textures/entity/wither/wither.png");
- public RenderUselessWither(RenderManager renderManagerIn)
- {
- super(renderManagerIn, new ModelWither(0.0F), 1.0F);
- }
- /**
- * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
- */
- protected ResourceLocation getEntityTexture(EntityWither entity)
- {
- int i = entity.getInvulTime();
- return i > 0 && (i > 80 || i / 5 % 2 != 1) ? INVULNERABLE_WITHER_TEXTURES : WITHER_TEXTURES;
- }
- /**
- * Allows the render to do state modifications necessary before the model is rendered.
- */
- protected void preRenderCallback(EntityWither entitylivingbaseIn, float partialTickTime)
- {
- float f = 2.0F;
- int i = entitylivingbaseIn.getInvulTime();
- if (i > 0)
- {
- f -= ((float)i - partialTickTime) / 220.0F * 0.5F;
- }
- GlStateManager.scale(f, f, f);
- }
- @Override
- @Nonnull
- protected ResourceLocation getEntityTexture(@Nonnull EntityUselessWither entity) {
- return WITHER_TEXTURES;
- }
- public static class Factory implements IRenderFactory<EntityUselessWither> {
- @Override
- public Render<? super EntityUselessWither> createRenderFor(RenderManager manager) {
- return new RenderUselessWither(manager);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement