Jump to content

Recommended Posts

Posted (edited)

I'm trying to add a block with a little transparency - (10% reduction of the texture's alpha).

 

The "isOpaqueCube" and "isTranslucent" methods are deprecated, but I can't find what they're supposed to be replaced by.

 

    @Override
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

    @Override
    public boolean isTranslucent(IBlockState state)
    {
        return true;
    }

    @Override
    public BlockRenderLayer getBlockLayer() {
        return BlockRenderLayer.TRANSLUCENT;
    }

 

These deprecated methods "work" (the blocks behind mine render correctly now), except I have a new issue where the faces between two of these blocks double up and create ugly faces.

 

Advice on both problems appreciated. 

 

jN4g7gh.png

Edited by viveleroi
Posted
4 minutes ago, viveleroi said:

The "isOpaqueCube" and "isTranslucent" methods are deprecated, but I can't find what they're supposed to be replaced by.

 

The deprecation of methods inside of the Block class (apart from forge-provided ones) mean "Don't call directly but is safe to override".

 

5 minutes ago, viveleroi said:

These deprecated methods "work" (the blocks behind mine render correctly now), except I have a new issue where the faces between two of these blocks double up and create ugly faces.

 

Override Block#shouldSideBeRendered

  • 5 months later...
Posted

im also having the same problem, where would would i paste 

@Override
    public boolean isOpaqueCube(IBlockState state)
    {
        return false;
    }

    @Override
    public boolean isTranslucent(IBlockState state)
    {
        return true;
    }

    @Override
    public BlockRenderLayer getBlockLayer() {
        return BlockRenderLayer.TRANSLUCENT;
    }

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.