Jump to content

[SOLVED] Setting translucent/opaque cube in 1.12


viveleroi

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 5 months later...

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;
    }
Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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