Jump to content

[1.20.x] Multilayer Block Rendering


Naamah

Recommended Posts

Hello,

I am creating am mod that adds different "compressed" versions of blocks. I am trying to get each block to have an overlay that is different on each stage of compression. The issue I have is, I don't know how to get multiple layers to work. I have the code for the block which works, but I can't figure out how to format the model/block json file to get it to render with 1 layer overlaying the other.
I have tried using something like this:

ItemBlockRenderTypes.setRenderLayer(ModBlocks.COAL_BLOCK_1X.get(), renderType -> renderType == RenderType.solid() || renderType == RenderType.translucent());
{
  "parent": "block/block",
  "loader": "forge:multi-layer",
  "layers": {
    "solid": {
      "parent": "block/cube_all",
      "textures": {
        "all": "minecraft:block/coal_block"
      },
      "transform": {
        "origin": "center",
        "scale": 1
      }
    },
    "translucent": {
      "parent": "block/cube_all",
      "textures": {
        "all": "maybecompressed:block/1x"
      }
    }
  },
  "textures": {
    "particle": "minecraft:block/coal_block"
  }
}

Which is based on the source of AllTheCompressed mod.

I also tried:

{
  "parent": "minecraft:block/cube_all",
  "textures": {
    "layer0": "minecraft:block/coal_block"
	"layer1": "maybecompressed:block/1x"
  }
}


I see that on the Forge docs ItemBlockRenderTypes#setRenderLayer() is depricated, but I am unsure of how to get around that.

tenor.gif?itemid=27352888

 

Not even gonna lie, I think I have autism

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