Jump to content

Recommended Posts

Posted

Hi guys i need help with wanting to add this as a layer to "RenderPlayer Class" from mc (i tried this in mcp but dont know how to or if even possible in forge because im pretty new to all of this)

 

So it would render the wither effect on to the player :P!..

 

here is the witherAura Class Code

-------------------------------------------

package com.example.examplemod.cosmetics;

import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelPlayer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.RenderWither;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

public class witherAura implements LayerRenderer<AbstractClientPlayer> {

    private static final ResourceLocation WITHER_ARMOR = new ResourceLocation("textures/entity/wither_armor.png");
    private final RenderPlayer witherRenderer;
    private ModelPlayer witherModel = new ModelPlayer(0.5f, true);

    public witherAura(RenderPlayer renderPlayer) {
        this.witherRenderer = renderPlayer;
        this.witherModel = renderPlayer.getMainModel();
    }

    @Override
    public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale) {

        GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
        this.witherRenderer.bindTexture(WITHER_ARMOR);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
        float f1 = MathHelper.cos(f * 0.02f) * 3.0f;
        float f2 = f * 0.01f;
        GlStateManager.translate(f1, f2, 0.0f);
        GlStateManager.matrixMode(5888);
        GlStateManager.enableAlpha();
        float f3 = 0.5f;
        GlStateManager.color(f3, f3, f3, 1.0f);
        GlStateManager.disableLighting();
        GlStateManager.blendFunc(1, 1);
        this.witherModel.setLivingAnimations(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks);
        this.witherModel.setModelAttributes(this.witherRenderer.getMainModel());
        this.witherModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        GlStateManager.matrixMode(5888);
        GlStateManager.enableAlpha();
        GlStateManager.disableBlend();

    }

    @Override
    public boolean shouldCombineTextures() {
        return true;
    }

}

 

then i want to add this to the render player thing ( sorry if im not making it clear what i exactly want cause idk myself lmao)

 

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.