Jump to content

Recommended Posts

Posted

Hi all!

I'm new to Forge modding.

I added a fluid in my mod, following the tutorial in the Tutorials section.

I tried adding the fluid's icons with the registerIcons() method, which takes a IconRegister parameter, but it gives me an error because in the  new version IconRegister doesn't exist, the new one is IIconRegister, but when I try to use it, it doesn't get called.

I also tried using the setIcons() method in the Fluid class, doing myFluid.setIcons(new IIcon(), new IIcon()), but it gives me an error because it can't be instantiated.

How can I solve this problem?

 

P.S. : Sorry for my bad english.

Posted

To use the setIcons() you will have to give it an already made IIcon object, where can we find that? In your fluid block class.

 

setIcons(myFluidBlock.getBlockTextureFromSide(side)

 

A good way to do this is in the TextureStitchEvent.

 

    @SubscribeEvent
    @SideOnly(Side.CLIENT)
    public void textureHook(TextureStitchEvent.Post event)
    {
        if (event.map.getTextureType() == 0)
        {
            myFluid.setIcons(myFluidBlock.getBlockTextureFromSide(1), myFluidBlock.getBlockTextureFromSide(2));
        }
    }

 

In your preInit:

        MinecraftForge.EVENT_BUS.register(this); //use the instance of your mod here!


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.