Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

[EDIT]

I just put this in the render class.

  @Override
    protected ResourceLocation getEntityTexture(EntityGolemObsidian entity) {
        if(entity.isLavaForm()) {

            if (entity.ticksExisted % 3 == 0) {
                this.textureIndex--;
            }

            if (textureIndex == -1) {
                textureIndex = 15;
            }

            return golemLavaTextures[textureIndex];
        }
        else {
            return golemObsidianTexture;
        }
    }

 

[OP]

Hello.

 

I have an entity where I would like lava to appear to be flowing down its body. I have tried to google every form of "forge animate entity texture" and have only seen threads where item and block textures are animated, or the model is animated. I have created a texture for each frame of the animation and my idea is to render one frame every or every other tick. I don't know how to tell Minecraft to render a new texture every tick. How do I do so? Or is there another more efficient manner of doing so?

 

The render class https://github.com/EstebanZapata/ObsidianTools/blob/mob/src/main/java/com/estebanzapata/obsidiantools/client/renderer/entity/RenderGolemObsidian.java

public class RenderGolemObsidian extends RenderLiving<EntityGolemObsidian> {

   // private static final ResourceLocation[] golemLavaTextures =  new ResourceLocation[16];
    private static final ResourceLocation golemObsidianTexture = new ResourceLocation(Reference.RESOURCE_PREFIX + "textures/entity/golemObsidian.png");
   // private static final ResourceLocation golemLavaTexture = new ResourceLocation(Reference.RESOURCE_PREFIX + "textures/entity/golemLava.png")

    public RenderGolemObsidian(RenderManager rendermanagerIn, ModelBase modelIn, float shadowSizeIn) {
        super(rendermanagerIn, modelIn, shadowSizeIn);
        //this.initLavaTextures();
    }

    /*protected void initLavaTextures() {
        for(int i = 0; i < golemLavaTextures.length; i++) {
            golemLavaTextures[i] = new ResourceLocation(Reference.RESOURCE_PREFIX + "textures/entity/golemLava" + i + ".png");
        }
    }*/


    @Override
    protected ResourceLocation getEntityTexture(EntityGolemObsidian entity) {
        return golemObsidianTexture;
    }


    protected void rotateCorpse(EntityGolemObsidian bat, float p_77043_2_, float p_77043_3_, float partialTicks)
    {
        super.rotateCorpse(bat, p_77043_2_, p_77043_3_, partialTicks);

        if ((double)bat.limbSwingAmount >= 0.01D)
        {
            float f = 13.0F;
            float f1 = bat.limbSwing - bat.limbSwingAmount * (1.0F - partialTicks) + 6.0F;
            float f2 = (Math.abs(f1 % f - f * 0.5F) - f * 0.25F) / (f * 0.25F);
            GlStateManager.rotate(6.5F * f2, 0.0F, 0.0F, 1.0F);
        }
    }
}

 

Client proxy https://github.com/EstebanZapata/ObsidianTools/blob/mob/src/main/java/com/estebanzapata/obsidiantools/proxy/ClientProxy.java

public class ClientProxy extends CommonProxy {
    public void preInit(FMLPreInitializationEvent event) {
        super.preInit(event);

        RenderingRegistry.registerEntityRenderingHandler(EntityGolemObsidian.class, new IRenderFactory<EntityGolemObsidian>() {
            @Override
            public Render<? super EntityGolemObsidian> createRenderFor(RenderManager manager) {
                return new RenderGolemObsidian(manager, new ModelGolemObsidian(), 0.5f);
            }
        });
    }

    public void init(FMLInitializationEvent event) {
        super.init(event);
        ItemsRender.init();
        BlocksRender.init();
    }

    public void postInit(FMLPostInitializationEvent event) {
        super.postInit(event);
    }
}

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.